Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-pcre2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-pcre2
Commits
afc3167a
Commit
afc3167a
authored
Mar 20, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for failed backrefs
parent
0b775774
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
backref_basic.vtc
src/tests/backref_basic.vtc
+14
-2
No files found.
src/tests/backref_basic.vtc
View file @
afc3167a
...
...
@@ -72,11 +72,18 @@ varnish v1 -vcl {
sub vcl_synth {
# Call to backref() before match()
set resp.http.nomatch = barbaz.backref(0, "fallback");
# Also tests the default fallback.
set resp.http.nomatch = barbaz.backref(0);
# match() and backref() now re-use the object's task scope
if (barbaz.match("barbaz")) {
set resp.http.bar0 = barbaz.backref(0, "error0");
# backref out of range
set resp.http.bar3 = barbaz.backref(3, "error3");
set resp.http.bar-1 = barbaz.backref(-1, "error-1");
set resp.http.barinf
= barbaz.backref(4294967296, "errorinf");
}
# match fails
...
...
@@ -107,8 +114,10 @@ client c1 -repeat 2 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.nomatch == "
fallback
"
expect resp.http.nomatch == "
**BACKREF METHOD FAILED**
"
expect resp.http.bar0 == "barbaz"
expect resp.http.bar3 == "error3"
expect resp.http.barinf == "errorinf"
expect resp.http.frob1 == "false"
expect resp.http.frob1-0 == "error0"
expect resp.http.frob1-1 == "error1"
...
...
@@ -128,6 +137,9 @@ client c1 -repeat 2 {
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect 0 * Begin req
expect * = VCL_Error "^vmod pcre2 error: barbaz.backref.0. called without prior match$"
expect * = VCL_Error "^vmod pcre2 error: in barbaz.backref.3.: unknown substring$"
expect * = VCL_Error "^vmod pcre2 error: ref .-1. out of range in barbaz.backref.. .must be >= 0 and <= 4294967295.$"
expect * = VCL_Error "^vmod pcre2 error: ref .4294967296. out of range in barbaz.backref.. .must be >= 0 and <= 4294967295.$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.0.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.1.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.2.: no match$"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment