Commit 9e622f98 authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Lasse Karstensen

Test the return value more closely

Conflicts:
	bin/varnishtest/tests/m00018.vtc
parent ed6fda4e
varnishtest "Test substring matching in std" varnishtest "Test std.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
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