aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-21 09:56:49 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-21 09:56:49 +0100
commitda4067b0dc30bc6b72e19122c57829b84a00bb94 (patch)
tree85ffd53c738d1fbc8d9df8de589e78c3072d6646 /test
parent90c979e64ea862c3a2c3e14aefe5a49c893d65cd (diff)
downloadrspamd-da4067b0dc30bc6b72e19122c57829b84a00bb94.tar.gz
rspamd-da4067b0dc30bc6b72e19122c57829b84a00bb94.zip
[Test] Small fixes on diff renderer
Diffstat (limited to 'test')
-rw-r--r--test/lua/rspamd_assertions.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/lua/rspamd_assertions.lua b/test/lua/rspamd_assertions.lua
index cebd13c54..728f8b9a6 100644
--- a/test/lua/rspamd_assertions.lua
+++ b/test/lua/rspamd_assertions.lua
@@ -77,6 +77,7 @@ local function rspamd_assert_table_diff_msg(_, tbl)
local v_actual = actual[i_v_actual]
if i_v_expect == i_v_actual then
+ -- table keys are the same: compare values
if type(v_expect) == 'table' and type(v_actual) == 'table' then
if util.table_cmp(v_expect, v_actual) then
-- we use the same value for 'actual' and 'expect' as soon as they're equal and don't bother us
@@ -86,15 +87,13 @@ local function rspamd_assert_table_diff_msg(_, tbl)
recurse(v_expect, v_actual, level + 1)
diff[#diff + 1] = format_table_end(level)
end
- elseif v_expect ~= v_actual then
- diff[#diff + 1] = format_line(level, i_v_expect, v_expect, v_actual)
else
diff[#diff + 1] = format_line(level, i_v_expect, v_expect, v_actual)
end
i_k_expect, i_v_expect = next(keys_expect, i_k_expect)
i_k_actual, i_v_actual = next(keys_actual, i_k_actual)
- elseif tostring(v_actual) > tostring(i_v_actual) then
+ elseif tostring(v_actual) > tostring(v_expect) then
diff[#diff + 1] = format_line(level, i_v_expect, v_expect, nil)
i_k_expect, i_v_expect = next(keys_expect, i_k_expect)
else