diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-16 12:07:08 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-16 12:07:08 +0100 |
commit | e4f16f2eaa5b32eef75076e86a3ccf0d79b3aa08 (patch) | |
tree | 2dfb611bda374e68e2b4b5a4016a6ef49e1da06b /test | |
parent | 7f1e0f5893b2a6e21aaa39b5e82c4aa576653ce8 (diff) | |
download | rspamd-e4f16f2eaa5b32eef75076e86a3ccf0d79b3aa08.tar.gz rspamd-e4f16f2eaa5b32eef75076e86a3ccf0d79b3aa08.zip |
[Minor] Add some more tests
Diffstat (limited to 'test')
-rw-r--r-- | test/lua/unit/expressions.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/lua/unit/expressions.lua b/test/lua/unit/expressions.lua index f2c4014b5..1e5d09cb5 100644 --- a/test/lua/unit/expressions.lua +++ b/test/lua/unit/expressions.lua @@ -93,7 +93,9 @@ context("Rspamd expressions", function() {'F && ((A + B + C + D) > 1)', 0}, {'(E) && ((B + B + B + B) >= 1)', 0}, {'!!C', 1}, - {'(B) & (D) & ((G) | (H) | (I) | (A))', 0} + {'(B) & (D) & ((G) | (H) | (I) | (A))', 0}, + {'A & C & (!D || !C || !E)', 1}, + {'A & C & !(D || C || E)', 0}, } for _,c in ipairs(cases) do local expr,err = rspamd_expression.create(c[1], @@ -102,8 +104,8 @@ context("Rspamd expressions", function() assert_not_nil(expr, "Cannot parse " .. c[1]) --print(expr) res = expr:process(atoms) - assert_equal(res, c[2], string.format("Processed expr '%s' returned '%d', expected: '%d'", - expr:to_string(), res, c[2])) + assert_equal(res, c[2], string.format("Processed expr '%s'{%s} returned '%d', expected: '%d'", + expr:to_string(), c[1], res, c[2])) end pool:destroy() |