vtest "regexp match and no-match"

server s1 {
	rxreq
	txresp -hdr "Foo: bar" -hdr "Bar: foo" -body "1111\n"
} -start

vinyl v1 -vcl+backend {

	sub vcl_backend_response {
		if (beresp.http.foo ~ "b" + "ar") {
			set beresp.http.foo1 = "1";
		} else {
			set beresp.status = 999;
		}
		if (beresp.http.bar !~ "bar") {
			set beresp.http.bar1 = "2";
		} else {
			set beresp.status = 999;
		}
	}

} -start

client c1 {
	txreq
	rxresp
	expect resp.status == "200"
	expect resp.http.foo1 == "1"
	expect resp.http.bar1 == "2"
} -run
