Lost test case from previous

parent 4b18cd06
......@@ -28,6 +28,7 @@ stamp-h1
*.log
*.trs
*.vtc
!src/vtc/vmod_taskvar_foreach.vtc
# vmodtool
......
varnishtest "test vmod-taskvar string foreach"
varnish v1 -vcl {
import taskvar;
import std;
backend proforma None;
sub vcl_init {
new str = taskvar.string();
}
sub iter {
std.log(str.get());
if (req.url == "/return") {
return (synth(404));
}
}
sub vcl_recv {
str.foreach(req.http.foo, iter);
return (synth(200));
}
} -start
logexpect l1 -v v1 -q "vxid == 1001" {
expect * 1001 VCL_call ^RECV
expect 0 = VCL_Log ^1$
expect 0 = VCL_Log ^2$
expect 0 = VCL_Log ^3$
expect 0 = VCL_Log ^4$
expect 0 = VCL_return ^synth
} -start
logexpect l2 -v v1 -q "vxid == 1002" {
expect * 1002 VCL_call ^RECV
expect 0 = VCL_Log ^1$
expect 0 = VCL_return ^synth
} -start
client c1 {
txreq -hdr "foo: 1,2,,3,,,4"
rxresp
expect resp.status == 200
txreq -url "/return" -hdr "foo: 1,2,,3,,,4"
rxresp
expect resp.status == 404
} -run
logexpect l1 -wait
\ No newline at end of file
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