[4.0] 9e622f9 Test the return value more closely
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 15 16:35:42 CET 2015
commit 9e622f988b6e8aadcd8059b91bcbdfd9101333e3
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Tue Oct 21 23:08:02 2014 +0100
Test the return value more closely
Conflicts:
bin/varnishtest/tests/m00018.vtc
diff --git a/bin/varnishtest/tests/m00018.vtc b/bin/varnishtest/tests/m00018.vtc
index b51ed18..35000ce 100644
--- a/bin/varnishtest/tests/m00018.vtc
+++ b/bin/varnishtest/tests/m00018.vtc
@@ -1,34 +1,24 @@
-varnishtest "Test substring matching in std"
+varnishtest "Test std.substr"
-server s1 {
- rxreq
- txresp
-
- rxreq
- txresp
+server s1 -repeat 2 {
+ rxreq
+ txresp
} -start
varnish v1 -vcl+backend {
import ${vmod_std};
sub vcl_deliver {
- if (std.strstr(req.url, "foo")) {
- set resp.http.sub = "found";
- } else {
- set resp.http.sub = "not found";
- }
-
+ set resp.http.sub = std.strstr(req.url, "b");
}
} -start
client c1 {
txreq -url "/foobar"
rxresp
- expect resp.http.sub == "found"
-
+ expect resp.http.sub == "bar"
txreq -url "/quux"
rxresp
- expect resp.http.sub == "not found"
+ expect resp.http.sub == ""
} -run
-
More information about the varnish-commit
mailing list