local s = logger.slog("%1 =?= %2", c.expect, actual_result)
print(s) --]]
- table.sort(actual_result)
- table.sort(c.expect)
- assert_rspamd_table_eq({actual = actual_result, expect = c.expect})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = c.expect})
end)
test("extract_specific_urls " .. i, function()
local s = logger.slog("case[%1] %2 =?= %3", i, c.expect, actual_result)
print(s) --]]
- table.sort(actual_result)
- table.sort(c.expect)
- assert_rspamd_table_eq({actual = actual_result, expect = c.expect})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = c.expect})
end)
end
print(s) --]]
local expect = {"abc.com", "abc.net", "abc.za.org"}
- table.sort(actual_result)
- table.sort(expect)
- assert_rspamd_table_eq({actual = actual_result, expect = expect})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = expect})
end)
end)
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result, expect = {"domain.com"}})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = {"domain.com"}})
end)
test("extract_specific_urls - from email 2 limit", function()
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result, expect = {"domain.com", "example.net"}})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = {"domain.com", "example.net"}})
end)
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result, expect = {"domain.com"}})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = {"domain.com"}})
end)
test("extract_specific_urls - from email image 2 limit", function()
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result, expect = {"domain.com", "example.net"}})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = {"domain.com", "example.net"}})
end)
test("extract_specific_urls - from email image 3 limit, no images", function()
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result, expect = {"domain.com", "example.net"}})
+ assert_rspamd_table_eq_sorted({actual = actual_result, expect = {"domain.com", "example.net"}})
end)
test("extract_specific_urls - from email image 3 limit, has images", function()
local actual = util.extract_specific_urls({
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result,
+ assert_rspamd_table_eq_sorted({actual = actual_result,
expect = {"domain.com", "example.net", "example5.org"}})
end)
test("extract_specific_urls - from email image 2 limit, has images", function()
local s = logger.slog("case[%1] %2 =?= %3", i, expect, actual_result)
print(s) --]]
- assert_rspamd_table_eq({actual = actual_result,
+ assert_rspamd_table_eq_sorted({actual = actual_result,
expect = {"domain.com", "example.net"}})
end)
end)