2004-06-16 03:02:07 +02:00
|
|
|
smtp = require("smtp")
|
|
|
|
|
2004-03-16 07:42:53 +01:00
|
|
|
function test_dot(original, right)
|
2004-06-16 03:02:07 +02:00
|
|
|
local result, n = smtp.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-16 03:02:07 +02:00
|
|
|
local result, n = smtp.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..")
|