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
75c80145
Commit
75c80145
authored
Oct 21, 2014
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test the return value more closely
parent
d387f091
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
m00018.vtc
bin/varnishtest/tests/m00018.vtc
+7
-17
No files found.
bin/varnishtest/tests/m00018.vtc
View file @
75c80145
varnishtest "Test s
ubstring matching in std
"
varnishtest "Test s
td.substr
"
server s1 {
server s1 -repeat 2 {
rxreq
rxreq
txresp
txresp
rxreq
txresp
} -start
} -start
varnish v1 -vcl+backend {
varnish v1 -vcl+backend {
import ${vmod_std};
import ${vmod_std};
sub vcl_deliver {
sub vcl_deliver {
if (std.strstr(req.url, "foo")) {
set resp.http.sub = std.strstr(req.url, "b");
set resp.http.sub = "found";
} else {
set resp.http.sub = "not found";
}
}
}
} -start
} -start
client c1 {
client c1 {
txreq -url "/foobar"
txreq -url "/foobar"
rxresp
rxresp
expect resp.http.sub == "found"
expect resp.http.sub == "bar"
txreq -url "/quux"
txreq -url "/quux"
rxresp
rxresp
expect resp.http.sub == "
not found
"
expect resp.http.sub == ""
} -run
} -run
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