Commit ef3a83c4 authored by Geoff Simmons's avatar Geoff Simmons

add tests for compile option caseless

(and some notes about what will be needed to test options that are
not yet supported)
parent b8b1316c
......@@ -292,3 +292,48 @@ varnish v1 -errvcl {vmod pcre2 error: Cannot compile '^a\u0041z' in r constructo
new r = pcre2.regex("^a\u0041z");
}
}
# XXX tests for alt_circumflex will require backrefs
# XXX tests for alt_verbnames will require retrieving the mark
# XXX auto_callout not implemented yet
# caseless
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("((?-i)[[:lower:]])[[:lower:]]",
caseless=true);
new r2 = pcre2.regex("a(?-i)b", caseless=true);
}
sub vcl_recv {
return(synth(200));
}
sub vcl_synth {
set resp.http.r1-1 = r1.match("ab");
set resp.http.r1-2 = r1.match("aB");
set resp.http.r1-3 = r1.match("Ab");
set resp.http.r1-4 = r1.match("AB");
set resp.http.r2-1 = r2.match("ab");
set resp.http.r2-2 = r2.match("Ab");
set resp.http.r2-3 = r2.match("aB");
set resp.http.r2-4 = r2.match("AB");
}
}
client c1 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.r1-1 == "true"
expect resp.http.r1-2 == "true"
expect resp.http.r1-3 == "false"
expect resp.http.r1-4 == "false"
expect resp.http.r2-1 == "true"
expect resp.http.r2-2 == "true"
expect resp.http.r2-3 == "false"
expect resp.http.r2-4 == "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