git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3247
d4fa192b-c00b-0410-8231-
f00ffab90ce4
--- /dev/null
+# $Id$
+
+test "Various VCL compiler coverage tests"
+
+varnish v1 -vcl {
+
+ backend b { .host = "127.0.0.1"; }
+
+ /* Test string regexp matching and "else if" */
+ sub vcl_recv {
+ if ((req.url ~ "foobar")) {
+ pass;
+ } else if (req.url ~ "snafu") {
+ pipe;
+ } else {
+ pass;
+ }
+ }
+}
+
+
+varnish v1 -vcl {
+
+ backend b { .host = "127.0.0.1"; }
+
+ /* test time and backend comparison */
+ sub vcl_fetch {
+ if (obj.ttl > 1d) {
+ set obj.ttl = 1d;
+ }
+ if (req.backend == b) {
+ set obj.ttl = 1d;
+ } else if (req.backend != b) {
+ set obj.ttl = 1h;
+ }
+ }
+
+}
+