aboutsummaryrefslogtreecommitdiff
path: root/test/mimetest.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-11-28 00:59:12 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-11-28 00:59:12 +0000
commit05e8f243851049cebda6c5b690d3cde0f1e2c874 (patch)
tree9799a322fee3aefb07eaafa00875f214ad2b7ea6 /test/mimetest.lua
parent50da56dbeeec0cc7856ac06057cb778b502e087b (diff)
downloadluasocket-05e8f243851049cebda6c5b690d3cde0f1e2c874.tar.gz
luasocket-05e8f243851049cebda6c5b690d3cde0f1e2c874.tar.bz2
luasocket-05e8f243851049cebda6c5b690d3cde0f1e2c874.zip
New LTN12 test procedures (still short, but growing)
LTN12 avoids coroutines.
Diffstat (limited to '')
-rw-r--r--test/mimetest.lua36
1 files changed, 0 insertions, 36 deletions
diff --git a/test/mimetest.lua b/test/mimetest.lua
index 834d99f..2f6b7a8 100644
--- a/test/mimetest.lua
+++ b/test/mimetest.lua
@@ -47,42 +47,6 @@ local function random(handle, io_err)
47 else return ltn12.source.empty(io_err or "unable to open file") end 47 else return ltn12.source.empty(io_err or "unable to open file") end
48end 48end
49 49
50local function format(chunk)
51 if chunk then
52 if chunk == "" then return "''"
53 else return string.len(chunk) end
54 else return "nil" end
55end
56
57local function show(name, input, output)
58 local sin = format(input)
59 local sout = format(output)
60 io.write(name, ": ", sin, " -> ", sout, "\n")
61end
62
63local function chunked(length)
64 local tmp
65 return function(chunk)
66 local ret
67 if chunk and chunk ~= "" then
68 tmp = chunk
69 end
70 ret = string.sub(tmp, 1, length)
71 tmp = string.sub(tmp, length+1)
72 if not chunk and ret == "" then ret = nil end
73 return ret
74 end
75end
76
77--[[
78local function named(f, name)
79 return function(chunk)
80 local ret = f(chunk)
81 show(name, chunk, ret)
82 return ret
83 end
84end
85]]
86 50
87local function named(f) 51local function named(f)
88 return f 52 return f