Commit 22c4b130 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add tests for the boolean operators and fix not operator

parent 4e1bc12c
......@@ -127,3 +127,24 @@ logexpect l1 -d 1 -g vxid -q "RespStatus !~ '^404$'" {
expect * = ReqEnd
expect * = End
} -run
# Test boolean and
logexpect l1 -d 1 -g vxid -q "RespStatus == 200 and RespStatus ~ '^200$'" {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
# Test boolean or
logexpect l1 -d 1 -g vxid -q "RespStatus == 404 or RespStatus ~ '^200$'" {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
# Test boolean !
logexpect l1 -d 1 -g vxid -q "RespStatus == 404 or !RespStatus ~ '^404$'" {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
......@@ -58,7 +58,6 @@ tokens = {
"T_NOMATCH": "!~",
# Boolean operators
"T_NOT": "not",
"T_AND": "and",
"T_OR": "or",
......
......@@ -218,7 +218,7 @@ vslq_exec(const struct vex *vex, struct VSL_transaction * const ptrans[])
if (r <= 0)
return (r);
return (vslq_exec(vex->b, ptrans));
case T_NOT:
case '!':
AN(vex->a);
AZ(vex->b);
r = vslq_exec(vex->a, ptrans);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment