Mercurial > hg > nginx-tests
comparison not_modified.t @ 417:1bdd58f388f6
Tests: weak etag tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 23 Jun 2014 00:31:50 +0400 |
parents | 5c25acbc870a |
children | f5f2a66853a9 |
comparison
equal
deleted
inserted
replaced
416:5c25acbc870a | 417:1bdd58f388f6 |
---|---|
19 ############################################################################### | 19 ############################################################################### |
20 | 20 |
21 select STDERR; $| = 1; | 21 select STDERR; $| = 1; |
22 select STDOUT; $| = 1; | 22 select STDOUT; $| = 1; |
23 | 23 |
24 my $t = Test::Nginx->new()->has('http')->plan(12) | 24 my $t = Test::Nginx->new()->has('http')->plan(14) |
25 ->write_file_expand('nginx.conf', <<'EOF'); | 25 ->write_file_expand('nginx.conf', <<'EOF'); |
26 | 26 |
27 %%TEST_GLOBALS%% | 27 %%TEST_GLOBALS%% |
28 | 28 |
29 daemon off; | 29 daemon off; |
78 like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); | 78 like(http_get_inm('/t', '"foo"'), qr/200/, 'if-none-match fail'); |
79 like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, | 79 like(http_get_inm('/t', '"foo", "bar", ' . $etag . ' , "baz"'), qr/304/, |
80 'if-none-match with complex list'); | 80 'if-none-match with complex list'); |
81 like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); | 81 like(http_get_inm('/t', '*'), qr/304/, 'if-none-match all'); |
82 | 82 |
83 TODO: { | |
84 local $TODO = 'not yet'; | |
85 | |
86 like(http_get_inm('/t', 'W/' . $etag), qr/304/, 'if-none-match weak'); | |
87 | |
88 } | |
89 | |
83 like(http_get_im('/t', $etag), qr/200/, 'if-match'); | 90 like(http_get_im('/t', $etag), qr/200/, 'if-match'); |
84 like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); | 91 like(http_get_im('/t', '"foo"'), qr/412/, 'if-match fail'); |
85 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), | 92 like(http_get_im('/t', '"foo", "bar", ' . "\t" . $etag . ' , "baz"'), |
86 qr/200/, 'if-match with complex list'); | 93 qr/200/, 'if-match with complex list'); |
87 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); | 94 like(http_get_im('/t', '*'), qr/200/, 'if-match all'); |
95 like(http_get_im('/t', 'W/' . $etag), qr/412/, 'if-match weak fail'); | |
88 | 96 |
89 ############################################################################### | 97 ############################################################################### |
90 | 98 |
91 sub http_get_ims { | 99 sub http_get_ims { |
92 my ($url, $ims) = @_; | 100 my ($url, $ims) = @_; |