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
0d1c9014
Commit
0d1c9014
authored
Feb 24, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for compile option newline
parent
bf433abf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
compile_opts.vtc
src/tests/compile_opts.vtc
+51
-0
newline_synth.vcl
src/tests/newline_synth.vcl
+40
-0
No files found.
src/tests/compile_opts.vtc
View file @
0d1c9014
...
...
@@ -686,3 +686,54 @@ client c1 {
expect resp.http.r6-4 == "false"
expect resp.http.r6-5 == "false"
} -run
# newline
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", newline=LF, multiline=true);
new r2 = pcre2.regex("^abc", newline=CRLF, multiline=true);
new r3 = pcre2.regex("^abc", newline=CR, multiline=true);
new r4 = pcre2.regex("^a.b", newline=LF);
new r5 = pcre2.regex("^a.b", newline=CR);
new r6 = pcre2.regex("^a.b", newline=ANYCRLF);
new r7 = pcre2.regex("^a.b", newline=ANY);
}
sub vcl_recv {
return(synth(200));
}
# As above
include "${vmod_topbuild}/src/tests/newline_synth.vcl";
}
client c1 {
txreq
rxresp
expect resp.status == "200"
expect resp.http.r1-1 == "true"
expect resp.http.r1-2 == "true"
expect resp.http.r1-3 == "false"
expect resp.http.r1-4 == "false"
expect resp.http.r1-5 == "false"
expect resp.http.r1-6 == "false"
expect resp.http.r1-7 == "false"
expect resp.http.r2-1 == "true"
expect resp.http.r2-2 == "false"
expect resp.http.r2-3 == "false"
expect resp.http.r3-1 == "true"
expect resp.http.r3-2 == "false"
expect resp.http.r3-3 == "false"
expect resp.http.r4-1 == "true"
expect resp.http.r4-2 == "false"
expect resp.http.r5-1 == "true"
expect resp.http.r5-2 == "false"
expect resp.http.r6-1 == "true"
expect resp.http.r6-2 == "false"
expect resp.http.r7-1 == "false"
expect resp.http.r7-2 == "false"
expect resp.http.r7-3 == "false"
} -run
src/tests/newline_synth.vcl
0 → 100644
View file @
0d1c9014
# -*-mode: vcl; coding: raw-text -*-
# For the newline 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({"xyz
abc"});
set resp.http.r1-2 = r1.match({"xyz
abc"});
set resp.http.r1-3 = r1.match({"xyz abc"});
set resp.http.r1-4 = r1.match({"xyzabc "});
set resp.http.r1-5 = r1.match({"xyzabc pqr"});
set resp.http.r1-6 = r1.match({"xyzabc
"});
set resp.http.r1-7 = r1.match({"xyzabc
pqr"});
set resp.http.r2-1 = r2.match({"xyz
abclf>"});
set resp.http.r2-2 = r2.match({"xyz
abclf"});
set resp.http.r2-3 = r2.match({"xyz abclf"});
set resp.http.r3-1 = r3.match({"xyz abc"});
set resp.http.r3-2 = r3.match({"xyz
abc"});
set resp.http.r3-3 = r3.match({"xyz
abc"});
set resp.http.r4-1 = r4.match({"a b"});
set resp.http.r4-2 = r4.match({"a
b"});
set resp.http.r5-1 = r5.match({"a
b"});
set resp.http.r5-2 = r5.match({"a b"});
set resp.http.r6-1 = r6.match({"ab"});
set resp.http.r6-2 = r6.match({"a b"});
set resp.http.r7-1 = r7.match({"a
b"});
set resp.http.r7-2 = r7.match({"a b"});
set resp.http.r7-3 = r7.match({"ab"});
}
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