aboutsummaryrefslogtreecommitdiffstats
path: root/test/lua/unit/expressions.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/lua/unit/expressions.lua')
-rw-r--r--test/lua/unit/expressions.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lua/unit/expressions.lua b/test/lua/unit/expressions.lua
index f191019e6..69a141f46 100644
--- a/test/lua/unit/expressions.lua
+++ b/test/lua/unit/expressions.lua
@@ -26,7 +26,17 @@ context("Rspamd expressions", function()
local cases = {
{'A & B | !C', 'A B & C ! |'},
- {'A & (B | !C)', 'A B C ! | &'}
+ {'A & (B | !C)', 'A B C ! | &'},
+ -- Unbalanced braces
+ {'(((A))', nil},
+ -- Balanced braces
+ {'(((A)))', 'A'},
+ -- Plus and comparision operators
+ {'A + B + C + D > 2', 'A B C D + + + 2 >'},
+ -- Plus and logic operators
+ {'((A + B + C + D) > 2) & D', 'A B C D + + + 2 > D &'},
+ -- Associativity
+ {'A | B | C & D & E', 'A B C D E & & | |'},
}
for _,c in ipairs(cases) do
local expr,err = rspamd_expression.create(c[1],