comparison http_host.t @ 1612:8659123d2d37

Tests: made http_content() exportable.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 17 Nov 2020 17:39:09 +0300
parents 27237569776f
children 5ac6efbe5552
comparison
equal deleted inserted replaced
1611:dbeb4c896f7e 1612:8659123d2d37
13 use Test::More; 13 use Test::More;
14 14
15 BEGIN { use FindBin; chdir($FindBin::Bin); } 15 BEGIN { use FindBin; chdir($FindBin::Bin); }
16 16
17 use lib 'lib'; 17 use lib 'lib';
18 use Test::Nginx; 18 use Test::Nginx qw/ :DEFAULT http_content /;
19 19
20 ############################################################################### 20 ###############################################################################
21 21
22 select STDERR; $| = 1; 22 select STDERR; $| = 1;
23 select STDOUT; $| = 1; 23 select STDOUT; $| = 1;
183 my ($r) = http(<<EOF); 183 my ($r) = http(<<EOF);
184 GET / HTTP/1.0 184 GET / HTTP/1.0
185 Host: $host 185 Host: $host
186 186
187 EOF 187 EOF
188 return ($all ? $r : Test::Nginx::http_content($r)); 188 return ($all ? $r : http_content($r));
189 } 189 }
190 190
191 sub http_absolute_path { 191 sub http_absolute_path {
192 my ($host, $all) = @_; 192 my ($host, $all) = @_;
193 my ($r) = http(<<EOF); 193 my ($r) = http(<<EOF);
194 GET http://$host/ HTTP/1.0 194 GET http://$host/ HTTP/1.0
195 Host: localhost 195 Host: localhost
196 196
197 EOF 197 EOF
198 return ($all ? $r : Test::Nginx::http_content($r)); 198 return ($all ? $r : http_content($r));
199 } 199 }
200 200
201 ############################################################################### 201 ###############################################################################