Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
b6f7816a
Commit
b6f7816a
authored
Sep 19, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add '<=' and '>=' operators
parent
2968fdf2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
l00001.vtc
bin/varnishtest/tests/l00001.vtc
+28
-0
vsl_query.c
lib/libvarnishapi/vsl_query.c
+26
-0
No files found.
bin/varnishtest/tests/l00001.vtc
View file @
b6f7816a
...
...
@@ -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
lib/libvarnishapi/vsl_query.c
View file @
b6f7816a
...
...
@@ -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
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment