aboutsummaryrefslogtreecommitdiff
path: root/test/stufftest.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/stufftest.lua')
-rw-r--r--test/stufftest.lua19
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 @@
1function test_dot(original, right)
2 local result, n = socket.smtp.dot(2, original)
3 assert(result == right, "->" .. result .. "<-")
4 print("ok")
5end
6
7function test_stuff(original, right)
8 local result, n = socket.smtp.dot(2, original)
9 assert(result == right, "->" .. result .. "<-")
10 print("ok")
11end
12
13test_dot("abc", "abc")
14test_dot("", "")
15test_dot("\r\n", "\r\n")
16test_dot("\r\n.", "\r\n..")
17test_dot(".\r\n.", "..\r\n..")
18test_dot(".\r\n.", "..\r\n..")
19test_dot("abcd.\r\n.", "abcd.\r\n..")