summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-06-17 14:28:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-06-17 14:28:58 +0100
commit6ea707966a87b98386250f43f6c4b2d840e0c5d2 (patch)
tree6e6aa752919151a44c05221f532884131b3d1b94 /test
parent8aae3eae774dae1e56e6b401b42aa20bd777112d (diff)
downloadrspamd-6ea707966a87b98386250f43f6c4b2d840e0c5d2.tar.gz
rspamd-6ea707966a87b98386250f43f6c4b2d840e0c5d2.zip
[Rework] Split operations processing and add more debug logs
Diffstat (limited to 'test')
-rw-r--r--test/lua/unit/expressions.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/lua/unit/expressions.lua b/test/lua/unit/expressions.lua
index ce6c92dca..c3a771c48 100644
--- a/test/lua/unit/expressions.lua
+++ b/test/lua/unit/expressions.lua
@@ -41,6 +41,7 @@ context("Rspamd expressions", function()
local pool = rspamd_mempool.create()
local cases = {
+ {'A & (!B | C)', '(A) (B) ! (C) | &'},
{'A & B | !C', '(C) ! (A) (B) & |'},
{'A & (B | !C)', '(A) (B) (C) ! | &'},
{'A & B &', nil},
@@ -48,8 +49,8 @@ context("Rspamd expressions", function()
{'(((A))', nil},
-- Balanced braces
{'(((A)))', '(A)'},
- -- Plus and comparison operators (after 2.6 this is not optimized, maybe we can return previous behaviour some day)
- {'A + B + C + D > 2', '(A) (B) (C) (D) + + + 2 >'},
+ -- Plus and comparison operators
+ {'A + B + C + D > 2', '(A) (B) (C) (D) +(4) 2 >'},
-- Plus and logic operators
{'((A + B + C + D) > 2) & D', '(D) (A) (B) (C) (D) +(4) 2 > &'},
-- Associativity
@@ -91,7 +92,7 @@ context("Rspamd expressions", function()
{'A & C & !(D || C || E)', 0},
{'A + B + C', 2},
{'A * 2.0 + B + C', 3},
- {'A * 2.0 + B - C', 0},
+ {'A * 2.0 + B - C', 1},
{'A / 2.0 + B - C', -0.5},
}
for _,c in ipairs(cases) do