varnishtest "builtin purge from vcl_recv{}"

server s1 {
	rxreq
	txresp -hdr "foo: 1"
	rxreq
	txresp -hdr "foo: 2"
} -start

varnish v1 -vcl+backend {
	sub vcl_recv {
		if (req.method == "PURGE") {
			return (purge);
		}
	}
} -start

client c1 {
	txreq
	rxresp
	expect resp.http.foo == 1

	txreq
	rxresp
	expect resp.http.foo == 1

	txreq -req PURGE
	rxresp
	expect resp.reason == "Purged"

	txreq
	rxresp
	expect resp.http.foo == 2

} -run
