From 2d1df4714e2736dbde7855ddcd76b4c1de822fa5 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 23 Jan 2012 21:58:02 +1000 Subject: Added a big bunch of example lua scripts for testing the speed of lua compiling. --- .../yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 LuaSL/testLua/yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua (limited to 'LuaSL/testLua/yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua') diff --git a/LuaSL/testLua/yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua b/LuaSL/testLua/yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua new file mode 100644 index 0000000..c3879f1 --- /dev/null +++ b/LuaSL/testLua/yueliang-0.4.1/orig-5.1.3/test/test_lzio.lua @@ -0,0 +1,41 @@ +--[[-------------------------------------------------------------------- + + test_lzio.lua + Test for lzio.lua + This file is part of Yueliang. + + Copyright (c) 2006 Kein-Hong Man + The COPYRIGHT file describes the conditions + under which this software may be distributed. + + See the ChangeLog for more information. + +----------------------------------------------------------------------]] + +-- manual test for lzio.lua lua-style chunk reader + +dofile("../lzio.lua") + +local z +function dump(z) + while true do + local c = luaZ:zgetc(z) + io.stdout:write("("..c..")") + if c == "EOZ" then break end + end + io.stdout:write("\n") +end + +-- luaZ:make_getS or luaZ:make_getF creates a chunk reader +-- luaZ:init makes a zio stream + +-- [[ +z = luaZ:init(luaZ:make_getS("hello, world!"), nil, "=string") +dump(z) +z = luaZ:init(luaZ:make_getS(", world!"), "hello", "=string") +dump(z) +z = luaZ:init(luaZ:make_getS("line1\nline2\n"), "", "=string") +dump(z) +z = luaZ:init(luaZ:make_getF("test_lzio.lua"), nil, "=string") +dump(z) +--]] -- cgit v1.1