stufftest.lua 529 B

123456789101112131415161718192021
  1. local mime = require("mime")
  2. function test_dot(original, right)
  3. local result, n = mime.dot(2, original)
  4. assert(result == right, "->" .. result .. "<-")
  5. print("ok")
  6. end
  7. function test_stuff(original, right)
  8. local result, n = mime.dot(2, original)
  9. assert(result == right, "->" .. result .. "<-")
  10. print("ok")
  11. end
  12. test_dot("abc", "abc")
  13. test_dot("", "")
  14. test_dot("\r\n", "\r\n")
  15. test_dot("\r\n.", "\r\n..")
  16. test_dot(".\r\n.", "..\r\n..")
  17. test_dot(".\r\n.", "..\r\n..")
  18. test_dot("abcd.\r\n.", "abcd.\r\n..")