changeset 416:5c25acbc870a

Tests: etags support is present in all supported branches.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 22 Jun 2014 22:13:57 +0400
parents 020c4e47ecac
children 1bdd58f388f6
files not_modified.t spdy.t
diffstat 2 files changed, 11 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/not_modified.t
+++ b/not_modified.t
@@ -71,23 +71,20 @@ SKIP: {
 my ($t1, $etag);
 
 $t1 = http_get('/t');
+$t1 =~ /ETag: (".*")/;
+$etag = $1;
 
-SKIP: {
-    skip "no etag support", 8 if $t1 !~ /ETag: (".*")/;
-    $etag = $1;
-
-    like(http_get_inm('/t', $etag), qr/304/, 'if-none-match');
-    like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail');
-    like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/,
+like(http_get_inm('/t', $etag), qr/304/, 'if-none-match');
+like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail');
+like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/,
 	'if-none-match with complex list');
-    like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all');
+like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all');
 
-    like(http_get_im('/t', $etag), qr/200/, 'if-match');
-    like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail');
-    like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'),
+like(http_get_im('/t', $etag), qr/200/, 'if-match');
+like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail');
+like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'),
 	qr/200/, 'if-match with complex list');
-    like(http_get_im('/t', '*'), qr/200/, 'if-match all');
-}
+like(http_get_im('/t', '*'), qr/200/, 'if-match all');
 
 ###############################################################################
 
--- a/spdy.t
+++ b/spdy.t
@@ -241,21 +241,14 @@ ok(grep ({ $_->{type} eq "SYN_REPLY" } @
 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames;
 is($frame->{headers}->{':status'}, '200 OK', 'proxy cache unconditional');
 
-my $etag = $frame->{headers}->{'etag'};
-
-SKIP: {
-skip 'no etag', 1 unless defined $etag;
-
 $sid2 = spdy_stream($sess, { path => '/proxy/t2.html',
-	headers => { "if-none-match" =>  $etag }
+	headers => { "if-none-match" => $frame->{headers}->{'etag'} }
 });
 $frames = spdy_read($sess, all => [{ sid => $sid2, fin => 1 }]);
 
 ($frame) = grep { $_->{type} eq "SYN_REPLY" } @$frames;
 is($frame->{headers}->{':status'}, 304, 'proxy cache conditional');
 
-}
-
 # request body (uses proxied response)
 
 $sess = new_session();