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
d183aed9
Commit
d183aed9
authored
Mar 20, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for compile option no_auto_capture
parent
38d53132
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
backref_basic.vtc
src/tests/backref_basic.vtc
+15
-0
compile_opts.vtc
src/tests/compile_opts.vtc
+2
-1
No files found.
src/tests/backref_basic.vtc
View file @
d183aed9
...
...
@@ -64,6 +64,7 @@ varnish v1 -vcl {
new frobnitz = pcre2.regex("(frob)(nitz)");
new barbaz = pcre2.regex("(bar)(baz)");
new azbc = pcre2.regex("(a|(z))(bc)");
new foo = pcre2.regex("(f)(o)(o)", no_auto_capture=true);
}
sub vcl_recv {
...
...
@@ -107,6 +108,12 @@ varnish v1 -vcl {
set resp.http.azbc-1 = azbc.backref(1, "error1");
set resp.http.azbc-2 = azbc.backref(2, "error2");
set resp.http.azbc-3 = azbc.backref(3, "error3");
set resp.http.foo = foo.match("foo");
set resp.http.foo-0 = foo.backref(0, "error0");
set resp.http.foo-1 = foo.backref(1, "error1");
set resp.http.foo-2 = foo.backref(2, "error2");
set resp.http.foo-3 = foo.backref(3, "error3");
}
}
...
...
@@ -132,6 +139,11 @@ client c1 -repeat 2 {
expect resp.http.azbc-1 == "a"
expect resp.http.azbc-2 == "error2"
expect resp.http.azbc-3 == "bc"
expect resp.http.foo == "true"
expect resp.http.foo-0 == "foo"
expect resp.http.foo-1 == "error1"
expect resp.http.foo-2 == "error2"
expect resp.http.foo-3 == "error3"
} -run
logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
...
...
@@ -147,5 +159,8 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VCL_Error" {
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.1.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in frobnitz.backref.2.: no match$"
expect * = VCL_Error "^vmod pcre2 error: in azbc.backref.2.: requested value is not set$"
expect * = VCL_Error "^vmod pcre2 error: in foo.backref.1.: unknown substring$"
expect * = VCL_Error "^vmod pcre2 error: in foo.backref.2.: unknown substring$"
expect * = VCL_Error "^vmod pcre2 error: in foo.backref.3.: unknown substring$"
expect * = End
} -run
src/tests/compile_opts.vtc
View file @
d183aed9
...
...
@@ -10,9 +10,10 @@ varnishtest "compile options"
# Most of the examples in this test are adapted from pcre2 testdata.
# extended option is tested in compile.vtc and match.vtc
# no_auto_capture tested in backref_basic.vtc
# XXX
# - tests for
no_auto_capture and
ungreedy require backrefs
# - tests for ungreedy require backrefs
# - tests for alt_verbnames will require retrieving the mark
# - auto_callout not implemented yet
# - test for dupnames will require capturing named refs
...
...
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