aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua')
-rw-r--r--LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua55
1 files changed, 0 insertions, 55 deletions
diff --git a/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua b/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua
deleted file mode 100644
index cfd3f4b..0000000
--- a/LuaSL/testLua/yueliang-0.4.1/orig-5.0.3/test/test_lzio.lua
+++ /dev/null
@@ -1,55 +0,0 @@
1--[[--------------------------------------------------------------------
2
3 test_lzio.lua
4 Test for lzio.lua
5 This file is part of Yueliang.
6
7 Copyright (c) 2005 Kein-Hong Man <khman@users.sf.net>
8 The COPYRIGHT file describes the conditions
9 under which this software may be distributed.
10
11 See the ChangeLog for more information.
12
13----------------------------------------------------------------------]]
14
15-- manual test for lzio.lua lua-style chunk reader
16
17require("../lzio")
18
19local z
20function dump(z)
21 while true do
22 local c = luaZ:zgetc(z)
23 io.stdout:write("("..c..")")
24 if c == "EOZ" then break end
25 end
26 io.stdout:write("\n")
27end
28
29-- luaZ:make_getS or luaZ:make_getF creates a chunk reader
30-- luaZ:init makes a zio stream
31
32-- [[
33z = luaZ:init(luaZ:make_getS("hello, world!"), nil, "=string")
34dump(z)
35z = luaZ:init(luaZ:make_getS(", world!"), "hello", "=string")
36dump(z)
37z = luaZ:init(luaZ:make_getS("line1\nline2\n"), "", "=string")
38dump(z)
39z = luaZ:init(luaZ:make_getF("test_lzio.lua"), nil, "=string")
40dump(z)
41--]]
42
43-- test read beyond end of file
44-- bug reported by Adam429
45--[[
46z = luaZ:init(luaZ:make_getF("test_lzio.lua"), nil, "=string")
47while true do
48 local c = luaZ:zgetc(z)
49 io.stdout:write("("..c..")")
50 if c == "EOZ" then break end
51end
52print(luaZ:zgetc(z))
53print(luaZ:zgetc(z))
54io.stdout:write("\n")
55--]]