Commit 219f3a94 authored by Geoff Simmons's avatar Geoff Simmons

add tests for compile option bsr=ANYCRLF

parent 23fda2fa
# -*-mode: vcl; coding: raw-text -*-
# For the bsr=ANYCRLF test in compile_opts.vtc. Loaded via include,
# since vcl.inline, which is used by vtc, apparently changes \r
# characters to \n.
sub vcl_synth {
set resp.http.r1-1 = r1.match({"a b"});
set resp.http.r1-2 = r1.match({"a
b"});
set resp.http.r1-3 = r1.match({"a
b"});
set resp.http.r1-4 = r1.match({"ab"});
set resp.http.r1-5 = r1.match({"a b"});
set resp.http.r2-1 = r2.match({"a
b"});
set resp.http.r2-2 = r2.match({"a
b"});
set resp.http.r2-3 = r2.match({"a
b"});
set resp.http.r2-4 = r2.match({"ab"});
set resp.http.r2-5 = r2.match({"a b"});
}
# -*-mode: vcl; coding: raw-text -*-
# For the bsr test in compile_opts.vtc. Loaded via include, since
# vcl.inline, which is used by vtc, apparently changes \r characters
# to \n.
# For the bsr=UNICODE test in compile_opts.vtc. Loaded via include,
# since vcl.inline, which is used by vtc, apparently changes \r
# characters to \n.
sub vcl_synth {
set resp.http.r1-1 = r1.match({"a
b"});
......
......@@ -105,7 +105,7 @@ client c1 {
expect resp.http.r2-2 == "true"
} -run
# bsr
# bsr=UNICODE
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
backend b { .host = "${bad_ip}"; }
......@@ -123,7 +123,7 @@ varnish v1 -vcl {
# Load vcl_synth from another file, since vcl.inline, which is
# used by vtc, apparently changes \r characters to \n.
include "${vmod_topbuild}/src/tests/bsr_synth.vcl";
include "${vmod_topbuild}/src/tests/bsr_unicode_synth.vcl";
}
client c1 {
......@@ -165,3 +165,37 @@ client c1 {
expect resp.http.r4-8 == "false"
expect resp.http.r4-9 == "false"
} -run
# bsr=ANYCRLF
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("a\R?b", bsr=ANYCRLF);
new r2 = pcre2.regex("a\R{2,4}b", bsr=ANYCRLF);
}
sub vcl_recv {
return(synth(200));
}
# As above
include "${vmod_topbuild}/src/tests/bsr_anycrlf_synth.vcl";
}
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 == "true"
expect resp.http.r1-4 == "false"
expect resp.http.r1-5 == "false"
expect resp.http.r2-1 == "true"
expect resp.http.r2-2 == "true"
expect resp.http.r2-3 == "true"
expect resp.http.r2-4 == "false"
expect resp.http.r2-5 == "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