[master] aedfa6e Get the last three lines in vtim.c tested also

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 25 11:07:12 CET 2015


commit aedfa6eae192ff1a064efa63c81834006abbaa54
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 25 10:06:57 2015 +0000

    Get the last three lines in vtim.c tested also

diff --git a/bin/varnishtest/tests/m00020.vtc b/bin/varnishtest/tests/m00020.vtc
index b75d997..4d76b40 100644
--- a/bin/varnishtest/tests/m00020.vtc
+++ b/bin/varnishtest/tests/m00020.vtc
@@ -9,7 +9,8 @@ varnish v1 -vcl+backend {
 	import ${vmod_std};
 
 	sub vcl_deliver {
-		set resp.http.x-date = std.time(req.http.x-date, now);
+		set resp.http.x-date = std.time(
+		    regsub(req.http.x-date, "z", " "), now);
 		if (std.time(req.http.x-date, now) < now - 1y) {
 			set resp.http.x-past = 1;
 		}
@@ -70,6 +71,7 @@ client c1 {
 	expect resp.http.x-date == "Mon, 20 Dec 2010 00:00:59 GMT"
 	delay .1
 
+	# Range tests
 	txreq -hdr "X-Date: Mon, 20 Dec 2010 00:00:61 GMT"
 	rxresp
 	expect resp.http.x-date != "Mon, 20 Dec 2010 00:00:61 GMT"
@@ -104,9 +106,25 @@ client c1 {
 	rxresp
 	delay .1
 
+	txreq -hdr "X-Date: Sun 31 Dec 1899 23:59:59 GMT"
+	rxresp
+	expect resp.http.x-date != "Sun 31 Dec 1899 23:59:59 GMT"
+	delay .1
+
+	# White space etc.
+	txreq -hdr "X-Date: z Wed, 29 Feb 2012 00:00:00 GMT"
+	rxresp
+	expect resp.http.x-date == "Wed, 29 Feb 2012 00:00:00 GMT"
+	delay .1
+
 	txreq -hdr "X-Date: Wedx 29 Feb 2012 00:00:00 GMT"
 	rxresp
 	expect resp.http.x-date != "Wed, 29 Feb 2012 00:00:00 GMT"
 	delay .1
 
+	txreq -hdr "X-Date: Wed, 29 Feb 2012 00:00:00 GMT x"
+	rxresp
+	expect resp.http.x-date != "Wed, 29 Feb 2012 00:00:00 GMT"
+	delay .1
+
 } -run



More information about the varnish-commit mailing list