Commit b6f7816a authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add '<=' and '>=' operators

parent 2968fdf2
......@@ -85,3 +85,31 @@ logexpect l1 -d 1 -g vxid -q "RespStatus > 199." {
expect * = ReqEnd
expect * = End
} -run
# Test '<=' operator on integers
logexpect l1 -d 1 -g vxid -q "RespStatus <= 200" {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
# Test '<=' operator on floats
logexpect l1 -d 1 -g vxid -q "RespStatus <= 200." {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
# Test '>=' operator on integers
logexpect l1 -d 1 -g vxid -q "RespStatus >= 200" {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
# Test '>=' operator on floats
logexpect l1 -d 1 -g vxid -q "RespStatus >= 200." {
expect * * Begin req
expect * = ReqEnd
expect * = End
} -run
......@@ -153,6 +153,32 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
default:
WRONG("Wrong value type");
}
case T_LEQ: /* <= */
switch (val->type) {
case VEX_INT:
if (recint <= val->val_int)
return (1);
return (0);
case VEX_FLOAT:
if (recfloat <= val->val_float)
return (1);
return (0);
default:
WRONG("Wrong value type");
}
case T_GEQ: /* >= */
switch (val->type) {
case VEX_INT:
if (recint >= val->val_int)
return (1);
return (0);
case VEX_FLOAT:
if (recfloat >= val->val_float)
return (1);
return (0);
default:
WRONG("Wrong value type");
}
case T_SEQ: /* eq */
assert(val->type == VEX_STRING);
if (reclen == val->val_stringlen + 1 &&
......
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