diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-21 15:42:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-21 15:42:57 +0100 |
commit | 276d5a92efb6f4c630a53398458b7286da048757 (patch) | |
tree | 5c28a5071b0db4f4766af30ef6cfb637511a7dc9 /test/lua | |
parent | 23b52c3eb70ba4a81d0eb84e7a1b4812027f1035 (diff) | |
download | rspamd-276d5a92efb6f4c630a53398458b7286da048757.tar.gz rspamd-276d5a92efb6f4c630a53398458b7286da048757.zip |
[Minor] Fix parsing of some misformed email addresses
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/unit/smtp_addr.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lua/unit/smtp_addr.lua b/test/lua/unit/smtp_addr.lua index 062c509d5..cfce20fcc 100644 --- a/test/lua/unit/smtp_addr.lua +++ b/test/lua/unit/smtp_addr.lua @@ -4,7 +4,7 @@ context("SMTP address check functions", function() local logger = require("rspamd_logger") local ffi = require("ffi") local util = require("rspamd_util") - require "fun" () + local fun = require "fun" ffi.cdef[[ struct rspamd_email_address { const char *raw; @@ -47,13 +47,13 @@ context("SMTP address check functions", function() } - each(function(case) + fun.each(function(case) test("Parse valid smtp addr: " .. case[1], function() local st = ffi.C.rspamd_email_address_from_smtp(case[1], #case[1]) assert_not_nil(st, "should be able to parse " .. case[1]) - each(function(k, ex) + fun.each(function(k, ex) if k == 'user' then local str = ffi.string(st.user, st.user_len) assert_equal(str, ex) @@ -81,7 +81,7 @@ context("SMTP address check functions", function() '<a@example.com><>', } - each(function(case) + fun.each(function(case) test("Parse invalid smtp addr: " .. case, function() local st = ffi.C.rspamd_email_address_from_smtp(case, #case) |