Commit 54295ce5 authored by Geoff Simmons's avatar Geoff Simmons

add tests for the one_line option

parent 5b126dae
# looks like -*- vcl -*-
varnishtest "literal, never_nl, dot_nl and case_sensitive options"
varnishtest "literal, never_nl, dot_nl, case_sensitive and one_line options"
# Tests from re2 testing/parse_test.cc and testing/re2_test.cc
varnish v1 -vcl {
......@@ -19,6 +19,8 @@ varnish v1 -vcl {
new dot2 = re2.regex("(?-s).", dot_nl=true);
new dot3 = re2.regex(".", dot_nl=true, never_nl=true);
new case = re2.regex("(?i)([wand]{5})", case_sensitive=true);
new not_one = re2.regex("^a$", posix_syntax=true);
new one = re2.regex("^a$", posix_syntax=true, one_line=true);
}
sub vcl_recv {
......@@ -73,6 +75,16 @@ def
set resp.http.case = "match";
set resp.http.case1 = case.backref(1);
}
if (not_one.match({"a
a
a"} )) {
set resp.http.not_one = "match";
}
if (one.match({"a
a
a"} )) {
set resp.http.one = "match";
}
}
} -start
......@@ -93,4 +105,6 @@ client c1 {
expect resp.http.dot3 == <undef>
expect resp.http.case == "match"
expect resp.http.case1 == "Wanda"
expect resp.http.not_one == "match"
expect resp.http.one == <undef>
} -run
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