comparison proxy_unfinished.t @ 1612:8659123d2d37

Tests: made http_content() exportable.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 17 Nov 2020 17:39:09 +0300
parents b82f54728e14
children d7ec131d305a
comparison
equal deleted inserted replaced
1611:dbeb4c896f7e 1612:8659123d2d37
22 use Socket qw/ CRLF /; 22 use Socket qw/ CRLF /;
23 23
24 BEGIN { use FindBin; chdir($FindBin::Bin); } 24 BEGIN { use FindBin; chdir($FindBin::Bin); }
25 25
26 use lib 'lib'; 26 use lib 'lib';
27 use Test::Nginx; 27 use Test::Nginx qw/ :DEFAULT http_content /;
28 28
29 ############################################################################### 29 ###############################################################################
30 30
31 select STDERR; $| = 1; 31 select STDERR; $| = 1;
32 select STDOUT; $| = 1; 32 select STDOUT; $| = 1;
142 chmod(0000, $t->testdir() . '/proxy_temp'); 142 chmod(0000, $t->testdir() . '/proxy_temp');
143 143
144 my $r = http_get_11('/proxy/big.html', sleep => 0.5); 144 my $r = http_get_11('/proxy/big.html', sleep => 0.5);
145 145
146 SKIP: { 146 SKIP: {
147 skip 'finished', 1 if length(Test::Nginx::http_content($r)) == 1024 * 1024 + 8; 147 skip 'finished', 1 if length(http_content($r)) == 1024 * 1024 + 8;
148 148
149 like($r, qr/X(?!.*\x0d\x0a?0\x0d\x0a?)/s, 'no proxy temp'); 149 like($r, qr/X(?!.*\x0d\x0a?0\x0d\x0a?)/s, 'no proxy temp');
150 150
151 } 151 }
152 152