vtest "Test std.substr"

server s1 {
	rxreq
	txresp
} -start

vinyl v1 -vcl+backend {
	import std;

	sub vcl_deliver {
		set resp.http.sub1 = std.strstr(req.http.one, "b");
		set resp.http.sub2 = std.strstr(req.http.two, "b");
		set resp.http.sub3 = std.strstr(req.http.unset, "b");
	}
} -start

client c1 {
	txreq -hdr "one: foobar" -hdr "two: quux"
	rxresp
	expect resp.http.sub1 == "bar"
	expect resp.http.sub2 == ""
	expect resp.http.sub3 == ""
} -run
