Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
Nils Goroll
libvmod-re2
Commits
1fd0f08b
Commit
1fd0f08b
authored
Mar 26, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for the sub() method and function when the match fails
parent
dc54c3fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
sub.vtc
src/tests/sub.vtc
+8
-1
No files found.
src/tests/sub.vtc
View file @
1fd0f08b
...
...
@@ -2,7 +2,6 @@
varnishtest "sub() method and function"
# Tests from re2 testing/re2_test.cc
varnish v1 -vcl {
import re2 from "${vmod_topbuild}/src/.libs/libvmod_re2.so";
backend be { .host = "${bad_ip}"; }
...
...
@@ -22,6 +21,7 @@ varnish v1 -vcl {
}
sub vcl_synth {
# Tests from re2 testing/re2_test.cc
set resp.http.pangram
= piglatin.sub("the quick brown fox jumps over the lazy dogs.",
"\2\1ay");
...
...
@@ -50,6 +50,10 @@ varnish v1 -vcl {
set resp.http.bplusf = re2.sub("b+", "bbbbbb", "bb");
set resp.http.bstar1f = re2.sub("b*", "bbbbbb", "bb");
set resp.http.bstar2f = re2.sub("b*", "aaaaa", "bb");
# Match failure
set resp.http.bfail = b.sub("acd", "x", "fallbackb");
set resp.http.bfailf = re2.sub("b", "acd", "x", "fallbackf");
}
} -start
...
...
@@ -78,4 +82,7 @@ client c1 {
expect resp.http.bplusf == "bb"
expect resp.http.bstar1f == "bb"
expect resp.http.bstar2f == "bbaaaaa"
expect resp.http.bfail == "fallbackb"
expect resp.http.bfailf == "fallbackf"
} -run
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