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
uplex-varnish
libvmod-re2
Commits
a7ebf4d6
Commit
a7ebf4d6
authored
Apr 21, 2021
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vtc tests mostly without .compile().
parent
c3f66757
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
9 additions
and
57 deletions
+9
-57
cached.vtc
src/tests/cached.vtc
+0
-1
compile_fail.vtc
src/tests/compile_fail.vtc
+0
-11
encoding.vtc
src/tests/encoding.vtc
+0
-6
hdr_filter.vtc
src/tests/hdr_filter.vtc
+0
-2
match.vtc
src/tests/match.vtc
+0
-1
options.vtc
src/tests/options.vtc
+0
-11
r00896.vtc
src/tests/r00896.vtc
+0
-1
r00913.vtc
src/tests/r00913.vtc
+0
-2
set.vtc
src/tests/set.vtc
+9
-7
set_extract.vtc
src/tests/set_extract.vtc
+0
-2
set_retrieve.vtc
src/tests/set_retrieve.vtc
+0
-8
set_sub.vtc
src/tests/set_sub.vtc
+0
-3
set_suball.vtc
src/tests/set_suball.vtc
+0
-2
No files found.
src/tests/cached.vtc
View file @
a7ebf4d6
...
@@ -13,7 +13,6 @@ varnish v1 -vcl+backend {
...
@@ -13,7 +13,6 @@ varnish v1 -vcl+backend {
new foobar = re2.set();
new foobar = re2.set();
foobar.add("foo");
foobar.add("foo");
foobar.add("bar");
foobar.add("bar");
foobar.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/compile_fail.vtc
View file @
a7ebf4d6
...
@@ -356,7 +356,6 @@ varnish v1 -vcl {
...
@@ -356,7 +356,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set();
new good = re2.set();
good.add("[a-b-c]");
good.add("[a-b-c]");
good.compile();
}
}
}
}
...
@@ -377,7 +376,6 @@ varnish v1 -vcl {
...
@@ -377,7 +376,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set();
new good = re2.set();
good.add("\Qabc\E");
good.add("\Qabc\E");
good.compile();
}
}
}
}
...
@@ -398,7 +396,6 @@ varnish v1 -vcl {
...
@@ -398,7 +396,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set();
new good = re2.set();
good.add("(?:a)");
good.add("(?:a)");
good.compile();
}
}
}
}
...
@@ -419,7 +416,6 @@ varnish v1 -vcl {
...
@@ -419,7 +416,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set();
new good = re2.set();
good.add("(?P<name>a)");
good.add("(?P<name>a)");
good.compile();
}
}
}
}
...
@@ -440,7 +436,6 @@ varnish v1 -vcl {
...
@@ -440,7 +436,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true);
new good = re2.set(posix_syntax=true);
good.add("(a++)");
good.add("(a++)");
good.compile();
}
}
}
}
...
@@ -461,7 +456,6 @@ varnish v1 -vcl {
...
@@ -461,7 +456,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true);
new good = re2.set(posix_syntax=true);
good.add("(a**)");
good.add("(a**)");
good.compile();
}
}
}
}
...
@@ -482,7 +476,6 @@ varnish v1 -vcl {
...
@@ -482,7 +476,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true);
new good = re2.set(posix_syntax=true);
good.add("(a?*)");
good.add("(a?*)");
good.compile();
}
}
}
}
...
@@ -503,7 +496,6 @@ varnish v1 -vcl {
...
@@ -503,7 +496,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true);
new good = re2.set(posix_syntax=true);
good.add("(a+*)");
good.add("(a+*)");
good.compile();
}
}
}
}
...
@@ -524,7 +516,6 @@ varnish v1 -vcl {
...
@@ -524,7 +516,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true);
new good = re2.set(posix_syntax=true);
good.add("(a{1}*)");
good.add("(a{1}*)");
good.compile();
}
}
}
}
...
@@ -555,7 +546,6 @@ varnish v1 -vcl {
...
@@ -555,7 +546,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true, perl_classes=true);
new good = re2.set(posix_syntax=true, perl_classes=true);
good.add("\d \s \w \D \S \W");
good.add("\d \s \w \D \S \W");
good.compile();
}
}
}
}
...
@@ -576,7 +566,6 @@ varnish v1 -vcl {
...
@@ -576,7 +566,6 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new good = re2.set(posix_syntax=true, word_boundary=true);
new good = re2.set(posix_syntax=true, word_boundary=true);
good.add("\b \B");
good.add("\b \B");
good.compile();
}
}
}
}
...
...
src/tests/encoding.vtc
View file @
a7ebf4d6
...
@@ -130,27 +130,21 @@ varnish v1 -vcl {
...
@@ -130,27 +130,21 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new ninebytes = re2.set();
new ninebytes = re2.set();
ninebytes.add("^.........$");
ninebytes.add("^.........$");
ninebytes.compile();
new threechars = re2.set(utf8=true);
new threechars = re2.set(utf8=true);
threechars.add("^...$");
threechars.add("^...$");
threechars.compile();
new bytes = re2.set();
new bytes = re2.set();
bytes.add({"^日扼語$"});
bytes.add({"^日扼語$"});
bytes.compile();
new chars = re2.set(utf8=true);
new chars = re2.set(utf8=true);
chars.add({"^日扼語$"});
chars.add({"^日扼語$"});
chars.compile();
new patternbytes = re2.set();
new patternbytes = re2.set();
patternbytes.add({"^.扼.$"});
patternbytes.add({"^.扼.$"});
patternbytes.compile();
new patternchars = re2.set(utf8=true);
new patternchars = re2.set(utf8=true);
patternchars.add({"^.扼.$"});
patternchars.add({"^.扼.$"});
patternchars.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/hdr_filter.vtc
View file @
a7ebf4d6
...
@@ -11,13 +11,11 @@ varnish v1 -vcl {
...
@@ -11,13 +11,11 @@ varnish v1 -vcl {
white.add("Foo:");
white.add("Foo:");
white.add("Bar:");
white.add("Bar:");
white.add("Baz: baz$");
white.add("Baz: baz$");
white.compile();
new black = re2.set(anchor=start);
new black = re2.set(anchor=start);
black.add("Chaotic:");
black.add("Chaotic:");
black.add("Evil:");
black.add("Evil:");
black.add("Wicked: wicked$");
black.add("Wicked: wicked$");
black.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/match.vtc
View file @
a7ebf4d6
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
new bar = re2.regex("bar");
new bar = re2.regex("bar");
new barset = re2.set();
new barset = re2.set();
barset.add("bar");
barset.add("bar");
barset.compile();
}
}
sub vcl_backend_response {
sub vcl_backend_response {
...
...
src/tests/options.vtc
View file @
a7ebf4d6
...
@@ -214,48 +214,37 @@ varnish v1 -vcl {
...
@@ -214,48 +214,37 @@ varnish v1 -vcl {
sub vcl_init {
sub vcl_init {
new literal = re2.set(literal=true);
new literal = re2.set(literal=true);
literal.add("(|)^$.[*+?]{5,10},\\");
literal.add("(|)^$.[*+?]{5,10},\\");
literal.compile();
new never1 = re2.set(never_nl=true);
new never1 = re2.set(never_nl=true);
never1.add("(.*)");
never1.add("(.*)");
never1.compile();
new never2 = re2.set(never_nl=true);
new never2 = re2.set(never_nl=true);
never2.add("(?s)(abc.*def)");
never2.add("(?s)(abc.*def)");
never2.compile();
new never3 = re2.set(never_nl=true);
new never3 = re2.set(never_nl=true);
never3.add({"(abc(.|
never3.add({"(abc(.|
)def)"});
)def)"});
never3.compile();
new never4 = re2.set(never_nl=true);
new never4 = re2.set(never_nl=true);
never4.add("(abc[^x]*def)");
never4.add("(abc[^x]*def)");
never4.compile();
new dot1 = re2.set(dot_nl=true);
new dot1 = re2.set(dot_nl=true);
dot1.add(".");
dot1.add(".");
dot1.compile();
new dot2 = re2.set(dot_nl=true);
new dot2 = re2.set(dot_nl=true);
dot2.add("(?-s).");
dot2.add("(?-s).");
dot2.compile();
new dot3 = re2.set(dot_nl=true, never_nl=true);
new dot3 = re2.set(dot_nl=true, never_nl=true);
dot3.add(".");
dot3.add(".");
dot3.compile();
new case = re2.set(case_sensitive=true);
new case = re2.set(case_sensitive=true);
case.add("(?i)([wand]{5})");
case.add("(?i)([wand]{5})");
case.compile();
new not_one = re2.set(posix_syntax=true);
new not_one = re2.set(posix_syntax=true);
not_one.add("^a$");
not_one.add("^a$");
not_one.compile();
new one = re2.set(posix_syntax=true, one_line=true);
new one = re2.set(posix_syntax=true, one_line=true);
one.add("^a$");
one.add("^a$");
one.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/r00896.vtc
View file @
a7ebf4d6
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
new longset = re2.set();
new longset = re2.set();
longset.add("^(abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij)");
longset.add("^(abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij|abcdefghij)");
longset.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/r00913.vtc
View file @
a7ebf4d6
...
@@ -16,11 +16,9 @@ varnish v1 -vcl+backend {
...
@@ -16,11 +16,9 @@ varnish v1 -vcl+backend {
new endset = re2.set();
new endset = re2.set();
endset.add("$");
endset.add("$");
endset.compile();
new emptyset = re2.set();
new emptyset = re2.set();
emptyset.add("");
emptyset.add("");
emptyset.compile();
}
}
sub vcl_backend_response {
sub vcl_backend_response {
...
...
src/tests/set.vtc
View file @
a7ebf4d6
...
@@ -17,16 +17,13 @@ varnish v1 -vcl+backend {
...
@@ -17,16 +17,13 @@ varnish v1 -vcl+backend {
new unanchored = re2.set();
new unanchored = re2.set();
unanchored.add("foo");
unanchored.add("foo");
unanchored.add("bar");
unanchored.add("bar");
unanchored.compile();
new unanchored_factored = re2.set();
new unanchored_factored = re2.set();
unanchored_factored.add("foo");
unanchored_factored.add("foo");
unanchored_factored.add("foobar");
unanchored_factored.add("foobar");
unanchored_factored.compile();
new unanchored_dollar = re2.set();
new unanchored_dollar = re2.set();
unanchored_dollar.add("foo$");
unanchored_dollar.add("foo$");
unanchored_dollar.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -242,11 +239,9 @@ varnish v1 -vcl {
...
@@ -242,11 +239,9 @@ varnish v1 -vcl {
new anchored = re2.set(anchor=both);
new anchored = re2.set(anchor=both);
anchored.add("foo");
anchored.add("foo");
anchored.add("bar");
anchored.add("bar");
anchored.compile();
new prefix = re2.set(anchor=both);
new prefix = re2.set(anchor=both);
prefix.add("/prefix/\d*");
prefix.add("/prefix/\d*");
prefix.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
@@ -337,7 +332,6 @@ varnish v1 -errvcl {vmod re2 failure: unanchored.add("("): Cannot compile '(': m
...
@@ -337,7 +332,6 @@ varnish v1 -errvcl {vmod re2 failure: unanchored.add("("): Cannot compile '(': m
unanchored.add("foo");
unanchored.add("foo");
unanchored.add("(");
unanchored.add("(");
unanchored.add("bar");
unanchored.add("bar");
unanchored.compile();
}
}
}
}
...
@@ -350,7 +344,6 @@ varnish v1 -errvcl {vmod re2 failure: anchored.add("("): Cannot compile '(': mis
...
@@ -350,7 +344,6 @@ varnish v1 -errvcl {vmod re2 failure: anchored.add("("): Cannot compile '(': mis
anchored.add("foo");
anchored.add("foo");
anchored.add("(");
anchored.add("(");
anchored.add("bar");
anchored.add("bar");
anchored.compile();
}
}
}
}
...
@@ -363,3 +356,12 @@ varnish v1 -errvcl {vmod re2 failure: empty.compile(): no patterns were added} {
...
@@ -363,3 +356,12 @@ varnish v1 -errvcl {vmod re2 failure: empty.compile(): no patterns were added} {
empty.compile();
empty.compile();
}
}
}
}
varnish v1 -errvcl {vmod re2 failure: empty set initialization: no patterns were added} {
import ${vmod_re2};
backend b None;
sub vcl_init {
new empty = re2.set();
}
}
src/tests/set_extract.vtc
View file @
a7ebf4d6
...
@@ -14,12 +14,10 @@ varnish v1 -vcl+backend {
...
@@ -14,12 +14,10 @@ varnish v1 -vcl+backend {
new s = re2.set();
new s = re2.set();
s.add("(.*)@([^.]*)", save=true);
s.add("(.*)@([^.]*)", save=true);
s.add("(.)(.).*", save=true);
s.add("(.)(.).*", save=true);
s.compile();
new n = re2.set();
new n = re2.set();
n.add("(.*)@([^.]*)");
n.add("(.*)@([^.]*)");
n.add("(.)(.).*", save=true);
n.add("(.)(.).*", save=true);
n.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
...
src/tests/set_retrieve.vtc
View file @
a7ebf4d6
...
@@ -14,7 +14,6 @@ varnish v1 -vcl+backend {
...
@@ -14,7 +14,6 @@ varnish v1 -vcl+backend {
new s = re2.set();
new s = re2.set();
s.add("foo", "baz");
s.add("foo", "baz");
s.add("bar", "quux");
s.add("bar", "quux");
s.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -301,7 +300,6 @@ varnish v1 -vcl+backend {
...
@@ -301,7 +300,6 @@ varnish v1 -vcl+backend {
sub vcl_init {
sub vcl_init {
new n = re2.set();
new n = re2.set();
n.add("foo", backend = b0);
n.add("foo", backend = b0);
n.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -504,7 +502,6 @@ varnish v1 -vcl+backend {
...
@@ -504,7 +502,6 @@ varnish v1 -vcl+backend {
new b = re2.set();
new b = re2.set();
b.add("foo", backend=b1);
b.add("foo", backend=b1);
b.add("bar", backend=b2);
b.add("bar", backend=b2);
b.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -722,7 +719,6 @@ varnish v1 -vcl+backend {
...
@@ -722,7 +719,6 @@ varnish v1 -vcl+backend {
sub vcl_init {
sub vcl_init {
new n = re2.set();
new n = re2.set();
n.add("foo");
n.add("foo");
n.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -914,12 +910,10 @@ varnish v1 -vcl {
...
@@ -914,12 +910,10 @@ varnish v1 -vcl {
new s = re2.set();
new s = re2.set();
s.add("foo");
s.add("foo");
s.add("bar", "baz");
s.add("bar", "baz");
s.compile();
new b = re2.set();
new b = re2.set();
b.add("foo", backend=be);
b.add("foo", backend=be);
b.add("bar");
b.add("bar");
b.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -1048,7 +1042,6 @@ varnish v1 -vcl+backend {
...
@@ -1048,7 +1042,6 @@ varnish v1 -vcl+backend {
new i = re2.set();
new i = re2.set();
i.add("foo", integer=47);
i.add("foo", integer=47);
i.add("bar", integer=-11);
i.add("bar", integer=-11);
i.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -1178,7 +1171,6 @@ varnish v1 -vcl {
...
@@ -1178,7 +1171,6 @@ varnish v1 -vcl {
new i = re2.set();
new i = re2.set();
i.add("foo", integer=47);
i.add("foo", integer=47);
i.add("bar", integer=-11);
i.add("bar", integer=-11);
i.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/set_sub.vtc
View file @
a7ebf4d6
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
...
@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
s.add("(qu|[b-df-hj-np-tv-z]*)([a-z]+)", save=true);
s.add("(qu|[b-df-hj-np-tv-z]*)([a-z]+)", save=true);
s.add("\w+", save=true);
s.add("\w+", save=true);
s.add("b", save=true);
s.add("b", save=true);
s.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -167,7 +166,6 @@ varnish v1 -vcl+backend {
...
@@ -167,7 +166,6 @@ varnish v1 -vcl+backend {
new n = re2.set();
new n = re2.set();
n.add("b");
n.add("b");
n.add("b+", save=true);
n.add("b+", save=true);
n.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
@@ -383,7 +381,6 @@ varnish v1 -vcl {
...
@@ -383,7 +381,6 @@ varnish v1 -vcl {
"\1/www\2", save=true);
"\1/www\2", save=true);
set_redir.add("^(https?://)(www\.domain\.com|stats\.domain\.com|www\.domaincae[0-9]{1,2}\.com)/preisvergleich(/|$)(.*)",
set_redir.add("^(https?://)(www\.domain\.com|stats\.domain\.com|www\.domaincae[0-9]{1,2}\.com)/preisvergleich(/|$)(.*)",
"\1preisvergleich.fs.domain.com/\4", save=true);
"\1preisvergleich.fs.domain.com/\4", save=true);
set_redir.compile();
}
}
sub vcl_recv {
sub vcl_recv {
...
...
src/tests/set_suball.vtc
View file @
a7ebf4d6
...
@@ -19,12 +19,10 @@ varnish v1 -vcl+backend {
...
@@ -19,12 +19,10 @@ varnish v1 -vcl+backend {
s.add("b", save=true);
s.add("b", save=true);
s.add("b+", save=true);
s.add("b+", save=true);
s.add("b*", save=true);
s.add("b*", save=true);
s.compile();
new n = re2.set();
new n = re2.set();
n.add("b");
n.add("b");
n.add("b+", save=true);
n.add("b+", save=true);
n.compile();
}
}
sub vcl_deliver {
sub vcl_deliver {
...
...
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