Commit 8fc8bdc6 authored by Geoff Simmons's avatar Geoff Simmons

add tests for non-capturing parentheses with the suball() function

parent 751883ce
...@@ -32,6 +32,10 @@ varnish v1 -vcl+backend { ...@@ -32,6 +32,10 @@ varnish v1 -vcl+backend {
set beresp.http.sub = barbaz.sub(beresp.http.foo, "\0\1\2"); set beresp.http.sub = barbaz.sub(beresp.http.foo, "\0\1\2");
set beresp.http.subf = re2.sub("(?:bar)(baz)", beresp.http.foo, set beresp.http.subf = re2.sub("(?:bar)(baz)", beresp.http.foo,
"\0\1\2"); "\0\1\2");
set beresp.http.suball
= barbaz.suball(beresp.http.foo, "\0\1\2");
set beresp.http.suballf
= re2.suball("(?:bar)(baz)", beresp.http.foo, "\0\1\2");
} }
} -start } -start
...@@ -47,6 +51,8 @@ client c1 { ...@@ -47,6 +51,8 @@ client c1 {
expect resp.http.foo2f == "fallback" expect resp.http.foo2f == "fallback"
expect resp.http.sub == "barbazbaz" expect resp.http.sub == "barbazbaz"
expect resp.http.subf == "barbazbaz" expect resp.http.subf == "barbazbaz"
expect resp.http.suball == "barbazbaz"
expect resp.http.suballf == "barbazbaz"
} -run } -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" { 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