varnishtest "VCL compiler coverage test: vcc_token.c"

varnish v1 -errvcl {Unterminated inline C source, starting at} " C{ "

varnish v1 -vcl {
	backend b { .host = "127.0.0.1"; }
	# comment
	sub vcl_recv { set req.url = "x"; }
}

varnish v1 -errvcl {Unterminated /* ... */ comment, starting at} {
	backend b { .host = "127.0.0.1"; }
	/*
}

varnish v1 -errvcl {Unterminated long-string, starting at} {
	backend b { .host = "127.0.0.1"; }
	{" }
}

varnish v1 -errvcl {Unterminated string at} {
	backend b { .host = "127.0.0.1"; }
	"
}

varnish v1 -cliok "param.set vcc_allow_inline_c true" -vcl {
	backend b { .host = "127.0.0.1"; }
	sub vcl_recv { C{ int i; (void)i; }C }
}

varnish v1 -errvcl {Syntax error at} {
	backend b { .host = "127.0.0.1"; }
	?
}

varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
	backend b { .host = "127.0.0.1"; }
	sub vcl_recv {
		if ("foo" + "bar" == 777) {
			set req.http.host = 1;
		}
	}
}

varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
	backend b { .host = "127.0.0.1"; }
	sub vcl_recv {
		if ("foo" + "bar" ==
		    777) {
			set req.http.host = 1;
		}
	}
}

varnish v1 -errvcl {Comparison of different types: STRING '==' INT} {
	backend b { .host = "127.0.0.1"; }
	sub vcl_recv {
		if ("foo" + "bar" ==


		    777) {
			set req.http.host = 1;
		}
	}
}

varnish v1 -errvcl {Unknown variable: 'req.http.req.http.foo'} {
	backend b { .host = "127.0.0.1"; }
	sub vcl_recv {
		set req.http.req.http.foo = "bar";
	}
}
