diff options
Diffstat (limited to 'test/stufftest.lua')
-rw-r--r-- | test/stufftest.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/stufftest.lua b/test/stufftest.lua new file mode 100644 index 0000000..5eb8005 --- /dev/null +++ b/test/stufftest.lua | |||
@@ -0,0 +1,19 @@ | |||
1 | function test_dot(original, right) | ||
2 | local result, n = socket.smtp.dot(2, original) | ||
3 | assert(result == right, "->" .. result .. "<-") | ||
4 | print("ok") | ||
5 | end | ||
6 | |||
7 | function test_stuff(original, right) | ||
8 | local result, n = socket.smtp.dot(2, original) | ||
9 | assert(result == right, "->" .. result .. "<-") | ||
10 | print("ok") | ||
11 | end | ||
12 | |||
13 | test_dot("abc", "abc") | ||
14 | test_dot("", "") | ||
15 | test_dot("\r\n", "\r\n") | ||
16 | test_dot("\r\n.", "\r\n..") | ||
17 | test_dot(".\r\n.", "..\r\n..") | ||
18 | test_dot(".\r\n.", "..\r\n..") | ||
19 | test_dot("abcd.\r\n.", "abcd.\r\n..") | ||