aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua')
-rw-r--r--LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua53
1 files changed, 0 insertions, 53 deletions
diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua
deleted file mode 100644
index 30259c8..0000000
--- a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/test/test_lzio_mk2.lua
+++ /dev/null
@@ -1,53 +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-2006 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
17local zio_init = require("../lzio_mk2")
18
19local z
20function dump(z)
21 while true do
22 local c = z:getc()
23 io.stdout:write("("..c..")")
24 if c == "EOZ" then break end
25 end
26 io.stdout:write("\n")
27end
28
29-- z = zio_init("@<filename>") for a file
30-- z = zio_init("<string>") for a string
31
32-- [[
33z = zio_init("hello, world!")
34dump(z)
35z = zio_init("line1\nline2\n")
36dump(z)
37z = zio_init("@test_lzio_mk2.lua")
38dump(z)
39--]]
40
41-- test read beyond end of file
42-- bug reported by Adam429
43--[[
44z = zio_init("@test_lzio_mk2.lua")
45while true do
46 local c = z:getc()
47 io.stdout:write("("..c..")")
48 if c == "EOZ" then break end
49end
50print(z:getc())
51print(z:getc())
52io.stdout:write("\n")
53--]]