2004-06-17 23:46:22 +02:00
|
|
|
mime = require("mime")
|
2004-06-16 03:02:07 +02:00
|
|
|
|
2004-03-16 07:42:53 +01:00
|
|
|
function test_dot(original, right)
|
2004-06-17 23:46:22 +02:00
|
|
|
local result, n = mime.dot(2, original)
|
2004-03-16 07:42:53 +01:00
|
|
|
assert(result == right, "->" .. result .. "<-")
|
|
|
|
print("ok")
|
|
|
|
end
|
|
|
|
|
|
|
|
function test_stuff(original, right)
|
2004-06-17 23:46:22 +02:00
|
|
|
local result, n = mime.dot(2, original)
|
2004-03-16 07:42:53 +01:00
|
|
|
assert(result == right, "->" .. result .. "<-")
|
|
|
|
print("ok")
|
|
|
|
end
|
|
|
|
|
|
|
|
test_dot("abc", "abc")
|
|
|
|
test_dot("", "")
|
|
|
|
test_dot("\r\n", "\r\n")
|
|
|
|
test_dot("\r\n.", "\r\n..")
|
|
|
|
test_dot(".\r\n.", "..\r\n..")
|
|
|
|
test_dot(".\r\n.", "..\r\n..")
|
|
|
|
test_dot("abcd.\r\n.", "abcd.\r\n..")
|