Commit f0b07502 authored by Geoff Simmons's avatar Geoff Simmons

add a test for compile option match_unset_backref

parent 60209e72
......@@ -521,3 +521,31 @@ varnish v1 -errvcl {vmod pcre2 error: Cannot set locale lPb2PZDb4KcfbKJPSww1cm6o
new r = pcre2.regex("", locale="lPb2PZDb4KcfbKJPSww1cm6omvoF");
}
}
# match_unset_backref
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new r1 = pcre2.regex("(\3)(\1)(a)", match_unset_backref=true);
new r2 = pcre2.regex("(\3)(\1)(a)");
}
sub vcl_recv {
return(synth(200));
}
sub vcl_synth {
set resp.http.r1 = r1.match("cat");
set resp.http.r2 = r2.match("cat");
}
}
client c1 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.r1 == "true"
expect resp.http.r2 == "false"
} -run
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