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
e0b0d233
Commit
e0b0d233
authored
Mar 20, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for compile opt ungreedy
parent
d183aed9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
1 deletion
+57
-1
compile_opts.vtc
src/tests/compile_opts.vtc
+57
-1
No files found.
src/tests/compile_opts.vtc
View file @
e0b0d233
...
...
@@ -13,7 +13,6 @@ varnishtest "compile options"
# no_auto_capture tested in backref_basic.vtc
# XXX
# - 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
...
...
@@ -811,6 +810,63 @@ varnish v1 -errvcl {vmod pcre2 error: parens_nest_limit (4294967296) out of rang
}
}
# ungreedy
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new r1 = pcre2.regex("<.*>");
new r2 = pcre2.regex("<.*?>");
new r3 = pcre2.regex("<.*>", ungreedy=true);
new r4 = pcre2.regex("(?U)<.*>");
new r5 = pcre2.regex("<.*?>", ungreedy=true);
new r6 = pcre2.regex("={3,}", ungreedy=true);
new r7 = pcre2.regex("(?U)={3,}?");
}
sub vcl_recv {
return(synth(200));
}
sub vcl_synth {
set resp.http.r1m = r1.match("abc<def>ghi<klm>nop");
set resp.http.r1b = r1.backref(0);
set resp.http.r2m = r2.match("abc<def>ghi<klm>nop");
set resp.http.r2b = r2.backref(0);
set resp.http.r3m = r3.match("abc<def>ghi<klm>nop");
set resp.http.r3b = r3.backref(0);
set resp.http.r4m = r4.match("abc<def>ghi<klm>nop");
set resp.http.r4b = r4.backref(0);
set resp.http.r5m = r5.match("abc<def>ghi<klm>nop");
set resp.http.r5b = r5.backref(0);
set resp.http.r6m = r6.match("abc========def");
set resp.http.r6b = r6.backref(0);
set resp.http.r7m = r7.match("abc========def");
set resp.http.r7b = r7.backref(0);
}
}
client c1 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.r1m == "true"
expect resp.http.r1b == "<def>ghi<klm>"
expect resp.http.r2m == "true"
expect resp.http.r2b == "<def>"
expect resp.http.r3m == "true"
expect resp.http.r3b == "<def>"
expect resp.http.r4m == "true"
expect resp.http.r4b == "<def>"
expect resp.http.r5m == "true"
expect resp.http.r5b == "<def>ghi<klm>"
expect resp.http.r6m == "true"
expect resp.http.r6b == "==="
expect resp.http.r7m == "true"
expect resp.http.r7b == "========"
} -run
# use_offset_limit
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
...
...
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