comparison dav.t @ 154:2644bad81b0b

Tests: add test for preread body and extra data problem.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 03 Jul 2011 18:32:32 +0400
parents 1e1975cd25ef
children c0ae29632905
comparison
equal deleted inserted replaced
153:26cf61c5ac35 154:2644bad81b0b
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(qw/http dav/)->plan(11); 24 my $t = Test::Nginx->new()->has(qw/http dav/)->plan(13);
25 25
26 $t->write_file_expand('nginx.conf', <<'EOF'); 26 $t->write_file_expand('nginx.conf', <<'EOF');
27 27
28 %%TEST_GLOBALS%% 28 %%TEST_GLOBALS%%
29 29
87 87
88 like($r, qr/204 No Content/, 'delete file'); 88 like($r, qr/204 No Content/, 'delete file');
89 unlike($r, qr/Content-Length|Transfer-Encoding/, 'no length in 204'); 89 unlike($r, qr/Content-Length|Transfer-Encoding/, 'no length in 204');
90 ok(!-f $t->testdir() . '/file', 'file deleted'); 90 ok(!-f $t->testdir() . '/file', 'file deleted');
91 91
92 $r = http(<<EOF . '0123456789' . 'extra');
93 PUT /file HTTP/1.1
94 Host: localhost
95 Connection: close
96 Content-Length: 10
97
98 EOF
99
100 like($r, qr/201 Created.*(Content-Length|\x0d\0a0\x0d\x0a)/ms,
101 'put file extra data');
102 TODO: {
103 local $TODO = 'not yet';
104
105 is(-s $t->testdir() . '/file', 10,
106 'put file extra data size');
107 }
108
92 TODO: { 109 TODO: {
93 local $TODO = 'broken in 0.8.32'; 110 local $TODO = 'broken in 0.8.32';
94 111
95 # 201 replies contain body, response should indicate it's empty 112 # 201 replies contain body, response should indicate it's empty
96 # before 0.8.32 chunked was explicitly disabled for 201 replies so 113 # before 0.8.32 chunked was explicitly disabled for 201 replies so