Commit a7ebf4d6 authored by Geoff Simmons's avatar Geoff Simmons

vtc tests mostly without .compile().

parent c3f66757
......@@ -13,7 +13,6 @@ varnish v1 -vcl+backend {
new foobar = re2.set();
foobar.add("foo");
foobar.add("bar");
foobar.compile();
}
sub vcl_recv {
......
......@@ -356,7 +356,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set();
good.add("[a-b-c]");
good.compile();
}
}
......@@ -377,7 +376,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set();
good.add("\Qabc\E");
good.compile();
}
}
......@@ -398,7 +396,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set();
good.add("(?:a)");
good.compile();
}
}
......@@ -419,7 +416,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set();
good.add("(?P<name>a)");
good.compile();
}
}
......@@ -440,7 +436,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true);
good.add("(a++)");
good.compile();
}
}
......@@ -461,7 +456,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true);
good.add("(a**)");
good.compile();
}
}
......@@ -482,7 +476,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true);
good.add("(a?*)");
good.compile();
}
}
......@@ -503,7 +496,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true);
good.add("(a+*)");
good.compile();
}
}
......@@ -524,7 +516,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true);
good.add("(a{1}*)");
good.compile();
}
}
......@@ -555,7 +546,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true, perl_classes=true);
good.add("\d \s \w \D \S \W");
good.compile();
}
}
......@@ -576,7 +566,6 @@ varnish v1 -vcl {
sub vcl_init {
new good = re2.set(posix_syntax=true, word_boundary=true);
good.add("\b \B");
good.compile();
}
}
......
......@@ -130,27 +130,21 @@ varnish v1 -vcl {
sub vcl_init {
new ninebytes = re2.set();
ninebytes.add("^.........$");
ninebytes.compile();
new threechars = re2.set(utf8=true);
threechars.add("^...$");
threechars.compile();
new bytes = re2.set();
bytes.add({"^日扼語$"});
bytes.compile();
new chars = re2.set(utf8=true);
chars.add({"^日扼語$"});
chars.compile();
new patternbytes = re2.set();
patternbytes.add({"^.扼.$"});
patternbytes.compile();
new patternchars = re2.set(utf8=true);
patternchars.add({"^.扼.$"});
patternchars.compile();
}
sub vcl_recv {
......
......@@ -11,13 +11,11 @@ varnish v1 -vcl {
white.add("Foo:");
white.add("Bar:");
white.add("Baz: baz$");
white.compile();
new black = re2.set(anchor=start);
black.add("Chaotic:");
black.add("Evil:");
black.add("Wicked: wicked$");
black.compile();
}
sub vcl_recv {
......
......@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
new bar = re2.regex("bar");
new barset = re2.set();
barset.add("bar");
barset.compile();
}
sub vcl_backend_response {
......
......@@ -214,48 +214,37 @@ varnish v1 -vcl {
sub vcl_init {
new literal = re2.set(literal=true);
literal.add("(|)^$.[*+?]{5,10},\\");
literal.compile();
new never1 = re2.set(never_nl=true);
never1.add("(.*)");
never1.compile();
new never2 = re2.set(never_nl=true);
never2.add("(?s)(abc.*def)");
never2.compile();
new never3 = re2.set(never_nl=true);
never3.add({"(abc(.|
)def)"});
never3.compile();
new never4 = re2.set(never_nl=true);
never4.add("(abc[^x]*def)");
never4.compile();
new dot1 = re2.set(dot_nl=true);
dot1.add(".");
dot1.compile();
new dot2 = re2.set(dot_nl=true);
dot2.add("(?-s).");
dot2.compile();
new dot3 = re2.set(dot_nl=true, never_nl=true);
dot3.add(".");
dot3.compile();
new case = re2.set(case_sensitive=true);
case.add("(?i)([wand]{5})");
case.compile();
new not_one = re2.set(posix_syntax=true);
not_one.add("^a$");
not_one.compile();
new one = re2.set(posix_syntax=true, one_line=true);
one.add("^a$");
one.compile();
}
sub vcl_recv {
......
......@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
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.compile();
}
sub vcl_recv {
......
......@@ -16,11 +16,9 @@ varnish v1 -vcl+backend {
new endset = re2.set();
endset.add("$");
endset.compile();
new emptyset = re2.set();
emptyset.add("");
emptyset.compile();
}
sub vcl_backend_response {
......
......@@ -17,16 +17,13 @@ varnish v1 -vcl+backend {
new unanchored = re2.set();
unanchored.add("foo");
unanchored.add("bar");
unanchored.compile();
new unanchored_factored = re2.set();
unanchored_factored.add("foo");
unanchored_factored.add("foobar");
unanchored_factored.compile();
new unanchored_dollar = re2.set();
unanchored_dollar.add("foo$");
unanchored_dollar.compile();
}
sub vcl_deliver {
......@@ -242,11 +239,9 @@ varnish v1 -vcl {
new anchored = re2.set(anchor=both);
anchored.add("foo");
anchored.add("bar");
anchored.compile();
new prefix = re2.set(anchor=both);
prefix.add("/prefix/\d*");
prefix.compile();
}
sub vcl_recv {
......@@ -337,7 +332,6 @@ varnish v1 -errvcl {vmod re2 failure: unanchored.add("("): Cannot compile '(': m
unanchored.add("foo");
unanchored.add("(");
unanchored.add("bar");
unanchored.compile();
}
}
......@@ -350,7 +344,6 @@ varnish v1 -errvcl {vmod re2 failure: anchored.add("("): Cannot compile '(': mis
anchored.add("foo");
anchored.add("(");
anchored.add("bar");
anchored.compile();
}
}
......@@ -363,3 +356,12 @@ varnish v1 -errvcl {vmod re2 failure: empty.compile(): no patterns were added} {
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();
}
}
......@@ -14,12 +14,10 @@ varnish v1 -vcl+backend {
new s = re2.set();
s.add("(.*)@([^.]*)", save=true);
s.add("(.)(.).*", save=true);
s.compile();
new n = re2.set();
n.add("(.*)@([^.]*)");
n.add("(.)(.).*", save=true);
n.compile();
}
sub vcl_deliver {
......
......@@ -14,7 +14,6 @@ varnish v1 -vcl+backend {
new s = re2.set();
s.add("foo", "baz");
s.add("bar", "quux");
s.compile();
}
sub vcl_deliver {
......@@ -301,7 +300,6 @@ varnish v1 -vcl+backend {
sub vcl_init {
new n = re2.set();
n.add("foo", backend = b0);
n.compile();
}
sub vcl_deliver {
......@@ -504,7 +502,6 @@ varnish v1 -vcl+backend {
new b = re2.set();
b.add("foo", backend=b1);
b.add("bar", backend=b2);
b.compile();
}
sub vcl_deliver {
......@@ -722,7 +719,6 @@ varnish v1 -vcl+backend {
sub vcl_init {
new n = re2.set();
n.add("foo");
n.compile();
}
sub vcl_deliver {
......@@ -914,12 +910,10 @@ varnish v1 -vcl {
new s = re2.set();
s.add("foo");
s.add("bar", "baz");
s.compile();
new b = re2.set();
b.add("foo", backend=be);
b.add("bar");
b.compile();
}
sub vcl_deliver {
......@@ -1048,7 +1042,6 @@ varnish v1 -vcl+backend {
new i = re2.set();
i.add("foo", integer=47);
i.add("bar", integer=-11);
i.compile();
}
sub vcl_deliver {
......@@ -1178,7 +1171,6 @@ varnish v1 -vcl {
new i = re2.set();
i.add("foo", integer=47);
i.add("bar", integer=-11);
i.compile();
}
sub vcl_recv {
......
......@@ -15,7 +15,6 @@ varnish v1 -vcl+backend {
s.add("(qu|[b-df-hj-np-tv-z]*)([a-z]+)", save=true);
s.add("\w+", save=true);
s.add("b", save=true);
s.compile();
}
sub vcl_deliver {
......@@ -167,7 +166,6 @@ varnish v1 -vcl+backend {
new n = re2.set();
n.add("b");
n.add("b+", save=true);
n.compile();
}
sub vcl_deliver {
......@@ -383,7 +381,6 @@ varnish v1 -vcl {
"\1/www\2", save=true);
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);
set_redir.compile();
}
sub vcl_recv {
......
......@@ -19,12 +19,10 @@ varnish v1 -vcl+backend {
s.add("b", save=true);
s.add("b+", save=true);
s.add("b*", save=true);
s.compile();
new n = re2.set();
n.add("b");
n.add("b+", save=true);
n.compile();
}
sub vcl_deliver {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment