commit 25f1c7c: [Test] Fix unit tests

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Sep 14 10:42:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-14 11:37:23 +0100
URL: https://github.com/rspamd/rspamd/commit/25f1c7c67f7e165803c887854b201b0240093475 (HEAD -> master)

[Test] Fix unit tests

---
 test/lua/rspamd_assertions.lua                   | 4 ++--
 test/lua/unit/lua_util.extract_specific_urls.lua | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/lua/rspamd_assertions.lua b/test/lua/rspamd_assertions.lua
index 72e79c4d4..8e483431d 100644
--- a/test/lua/rspamd_assertions.lua
+++ b/test/lua/rspamd_assertions.lua
@@ -20,8 +20,8 @@ end
 local function rspamd_assert_table_equals_sorted(tbl)
   local expect = util.deepcopy(tbl.expect)
   local actual = util.deepcopy(tbl.actual)
-  table.sort(expect)
-  table.sort(actual)
+  util.deepsort(expect)
+  util.deepsort(actual)
   return util.table_cmp(expect, actual)
 end
 
diff --git a/test/lua/unit/lua_util.extract_specific_urls.lua b/test/lua/unit/lua_util.extract_specific_urls.lua
index 71c83e35c..b1a9b07d2 100644
--- a/test/lua/unit/lua_util.extract_specific_urls.lua
+++ b/test/lua/unit/lua_util.extract_specific_urls.lua
@@ -108,8 +108,8 @@ context("Lua util - extract_specific_urls plain", function()
   local cases = {
     {expect = url_list, filter = nil, limit = 9999, need_emails = true, prefix = 'p'},
     {expect = {}, filter = (function() return false end), limit = 9999, need_emails = true, prefix = 'p'},
-    {expect = {"tesco.co.net", "test.com"}, filter = nil, limit = 2, need_emails = true, prefix = 'p'},
-    {expect = {"tesco.co.net", "test.com", "meet.org"}, filter = nil, limit = 3, need_emails = true, prefix = 'p'},
+    {expect = {"domain4.co.net", "test.com"}, filter = nil, limit = 2, need_emails = true, prefix = 'p'},
+    {expect = {"domain4.co.net", "test.com", "domain3.org"}, filter = nil, limit = 3, need_emails = true, prefix = 'p'},
     {
       expect = {"gov.co.net", "tesco.co.net", "domain1.co.net", "domain2.co.net", "domain3.co.net", "domain4.co.net"},
       filter = (function(s) return s:get_host():sub(-4) == ".net" end),


More information about the Commits mailing list