Commit bcf99840 by Geoff Simmons

Test set.matched() with a negative argument.

parent e87c2c47
Pipeline #343 skipped
......@@ -34,7 +34,7 @@ varnish v1 -vcl {
set resp.http.unanchored1 = unanchored.match("foobar");
set resp.http.unanchored1n = unanchored.nmatches();
# set resp.http.unanchored1--1 = unanchored.matched(-1);
set resp.http.unanchored1--1 = unanchored.matched(-1);
set resp.http.unanchored1-0 = unanchored.matched(0);
set resp.http.unanchored1-1 = unanchored.matched(1);
set resp.http.unanchored1-2 = unanchored.matched(2);
......@@ -104,6 +104,7 @@ client c1 {
expect resp.http.unanchored-1-illegal == "false"
expect resp.http.unanchored1 == "true"
expect resp.http.unanchored1n == "2"
expect resp.http.unanchored1--1 == "false"
expect resp.http.unanchored1-0 == "false"
expect resp.http.unanchored1-1 == "true"
expect resp.http.unanchored1-2 == "true"
......@@ -142,6 +143,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect 0 * Begin req
expect * = VCL_Error "^vmod re2 error: unanchored.nmatches.. called without prior match$"
expect * = VCL_Error "^vmod re2 error: unanchored.matched.1. called without prior match$"
expect * = VCL_Error "^vmod re2 error: n=-1 out of range in unanchored.matched.. .2 patterns.$"
expect * = VCL_Error "^vmod re2 error: n=0 out of range in unanchored.matched.. .2 patterns.$"
expect * = VCL_Error "^vmod re2 error: n=3 out of range in unanchored.matched.. .2 patterns.$"
expect * = End
......
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