diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-01 12:21:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-01 12:41:12 +0100 |
commit | f03c580c859d65ad13742501b2b855a40bcfd488 (patch) | |
tree | 2dd23d397504e03ca7e0a64df1846273b3ca7384 /test/lua | |
parent | 4f86cbac459a99f2fbebde17db4be9f43ba794bf (diff) | |
download | rspamd-f03c580c859d65ad13742501b2b855a40bcfd488.tar.gz rspamd-f03c580c859d65ad13742501b2b855a40bcfd488.zip |
[Test] Add some more rfc2047 tricky cases
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/unit/rfc2047.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/lua/unit/rfc2047.lua b/test/lua/unit/rfc2047.lua index 6054c5ca2..9c83f37b8 100644 --- a/test/lua/unit/rfc2047.lua +++ b/test/lua/unit/rfc2047.lua @@ -44,6 +44,8 @@ context("RFC2047 decoding", function() {'v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoni.za.org; s=testdkim1;', 'v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoni.za.org; s=testdkim1;'}, {"=?windows-1251?B?xO7q8+zl7fIuc2NyLnV1ZQ==?=", "Документ.scr.uue"}, + {"=?UTF-8?Q?=20wie=20ist=20es=20Ihnen=20ergangen?.pdf?=", " wie ist es Ihnen ergangen?.pdf"}, -- ? inside + {"=?UTF-8?Q?=20wie=20ist=20es=20Ihnen=20ergangen??=", " wie ist es Ihnen ergangen?"}, -- ending ? inside } local pool = ffi.C.rspamd_mempool_new_(4096, "lua", 0, "rfc2047.lua:49") @@ -52,7 +54,7 @@ context("RFC2047 decoding", function() local res = ffi.C.rspamd_mime_header_decode(pool, c[1], #c[1]) res = ffi.string(res) assert_not_nil(res, "cannot decode " .. c[1]) - assert_equal(res, c[2], res .. " not equal " .. c[2]) + assert_rspamd_eq({actual = res, expect = c[2]}) end @@ -79,7 +81,7 @@ context("RFC2047 decoding", function() local res = ffi.C.rspamd_mime_header_decode(pool, s, #s) res = ffi.string(res) assert_not_nil(res, "cannot decode " .. s) - assert_equal(res, str, res .. " not equal " .. str .. " on " .. tostring(i) .. " iteration") + assert_rspamd_eq({actual = res, expect = str}) end end |