Commit 3e94935f authored by Geoff Simmons's avatar Geoff Simmons

Fix tests that fail for recent linre2 versions.

Since 2020-06-01, backrefs fail if numbered higher than the highest
backref actually captured- Previously, re2 returned the empty string.

I believe that these tests will now pass for both current and earlier
versions.
parent d0842984
......@@ -29,17 +29,17 @@ varnish v1 -vcl+backend {
} else {
set beresp.status = 999;
}
set beresp.http.sub = barbaz.sub(beresp.http.foo, "\0\1\2");
set beresp.http.sub = barbaz.sub(beresp.http.foo, "\0\1");
set beresp.http.subf = re2.sub("(?:bar)(baz)", beresp.http.foo,
"\0\1\2");
"\0\1");
set beresp.http.suball
= barbaz.suball(beresp.http.foo, "\0\1\2");
= barbaz.suball(beresp.http.foo, "\0\1");
set beresp.http.suballf
= re2.suball("(?:bar)(baz)", beresp.http.foo, "\0\1\2");
= re2.suball("(?:bar)(baz)", beresp.http.foo, "\0\1");
set beresp.http.extract
= barbaz.extract(beresp.http.foo, "\0\1\2");
= barbaz.extract(beresp.http.foo, "\0\1");
set beresp.http.extractf
= re2.extract("(?:bar)(baz)", beresp.http.foo, "\0\1\2");
= re2.extract("(?:bar)(baz)", beresp.http.foo, "\0\1");
}
} -start
......
......@@ -9,12 +9,12 @@ varnish v1 -vcl {
sub vcl_init {
new s = re2.set();
s.add("(.*)@([^.]*)", save=true);
s.add(".*", save=true);
s.add("(.)(.).*", save=true);
s.compile();
new n = re2.set();
n.add("(.*)@([^.]*)");
n.add(".*", save=true);
n.add("(.)(.).*", save=true);
n.compile();
}
......@@ -72,13 +72,13 @@ client c1 {
expect resp.http.s-nmatches == "2"
expect resp.http.s-extract == ""
expect resp.http.s-first == "kremvax!boris"
expect resp.http.s-last == "!"
expect resp.http.s-last == "o!b"
expect resp.http.n-match == "true"
expect resp.http.n-n == "2"
expect resp.http.n-extract == ""
expect resp.http.n-first == ""
expect resp.http.n-last == "!"
expect resp.http.n-last == "o!b"
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
......
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