aboutsummaryrefslogtreecommitdiff
path: root/test/stufftest.lua
blob: 5eb80050c3a56ec8e4d82cf07029d008ec138762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function test_dot(original, right)
    local result, n = socket.smtp.dot(2, original)
    assert(result == right, "->" .. result .. "<-")
    print("ok")
end

function test_stuff(original, right)
    local result, n = socket.smtp.dot(2, original)
    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..")