comparison perl.t @ 1180:a69de1aba1ad

Tests: added perl test with not satisfiable range.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 02 Jun 2017 13:28:04 +0300
parents 8241ebbe753d
children fe0765147e15
comparison
equal deleted inserted replaced
1179:660147bfe68c 1180:a69de1aba1ad
21 ############################################################################### 21 ###############################################################################
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(16) 26 my $t = Test::Nginx->new()->has(qw/http perl rewrite/)->plan(17)
27 ->write_file_expand('nginx.conf', <<'EOF'); 27 ->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
31 daemon off; 31 daemon off;
171 . 'Host: localhost' . CRLF 171 . 'Host: localhost' . CRLF
172 . 'Range: bytes=0-1,3-5' . CRLF . CRLF 172 . 'Range: bytes=0-1,3-5' . CRLF . CRLF
173 ), qr/Content-Length: (?!42).*^xx\x0d.*^xxx\x0d/ms, 173 ), qr/Content-Length: (?!42).*^xx\x0d.*^xxx\x0d/ms,
174 'perl header_out content-length multipart'); 174 'perl header_out content-length multipart');
175 175
176 TODO: {
177 local $TODO = 'not yet';
178
179 like(http(
180 'GET /range HTTP/1.0' . CRLF
181 . 'Host: localhost' . CRLF
182 . 'Range: bytes=100000-' . CRLF . CRLF
183 ), qr|^\QHTTP/1.1 416\E.*(?!xxx)|ms, 'perl range not satisfiable');
184
185 }
186
176 # various request body tests 187 # various request body tests
177 188
178 like(http( 189 like(http(
179 'GET /body HTTP/1.0' . CRLF 190 'GET /body HTTP/1.0' . CRLF
180 . 'Host: localhost' . CRLF 191 . 'Host: localhost' . CRLF