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
7d82ddb7
Commit
7d82ddb7
authored
Feb 23, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for compile option dollar_endonly
parent
639de485
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
compile_opts.vtc
src/tests/compile_opts.vtc
+39
-0
dotall_synth.vcl
src/tests/dotall_synth.vcl
+17
-0
No files found.
src/tests/compile_opts.vtc
View file @
7d82ddb7
...
@@ -338,6 +338,45 @@ client c1 {
...
@@ -338,6 +338,45 @@ client c1 {
expect resp.http.r2-4 == "false"
expect resp.http.r2-4 == "false"
} -run
} -run
# dollar_endonly
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("abc$", dollar_endonly=true);
new r2 = pcre2.regex("abc$");
}
sub vcl_recv {
return(synth(200));
}
sub vcl_synth {
set resp.http.r1-1 = r1.match("abc");
set resp.http.r2-1 = r2.match("abc");
set resp.http.r1-2 = r1.match({"abc
"});
set resp.http.r2-2 = r2.match({"abc
"});
set resp.http.r1-3 = r1.match({"abc
def"});
set resp.http.r2-3 = r2.match({"abc
def"});
}
}
client c1 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.r1-1 == "true"
expect resp.http.r1-2 == "false"
expect resp.http.r1-3 == "false"
expect resp.http.r2-1 == "true"
expect resp.http.r2-2 == "true"
expect resp.http.r2-3 == "false"
} -run
# dotall
# dotall
varnish v1 -vcl {
varnish v1 -vcl {
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
import pcre2 from "${vmod_topbuild}/src/.libs/libvmod_pcre2.so";
...
...
src/tests/dotall_synth.vcl
0 → 100644
View file @
7d82ddb7
# -*-mode: vcl; coding: raw-text -*-
# For the dotall test in compile_opts.vtc. Loaded via include, since
# vcl.inline, which is used by vtc, apparently changes \r characters
# to \n.
sub vcl_synth {
set resp.http.r1-1 = r1.match({"12
34"});
set resp.http.r2-1 = r2.match({"12
34"});
set resp.http.r1-2 = r1.match({"12 34"});
set resp.http.r2-2 = r2.match({"12 34"});
set resp.http.r3 = r3.match({"abc
def"});
set resp.http.r4 = r4.match({"abc
def"});
}
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