aboutsummaryrefslogtreecommitdiff
path: root/test/mimetest.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/mimetest.lua')
-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