| 1 |
#!/usr/bin/env perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
|
| 6 |
use HTTPTest; |
| 7 |
|
| 8 |
|
| 9 |
############################################################################### |
| 10 |
|
| 11 |
my $dummyfile = <<EOF; |
| 12 |
Don't care. |
| 13 |
EOF |
| 14 |
|
| 15 |
# code, msg, headers, content |
| 16 |
my %urls = ( |
| 17 |
'/dummy.html' => { |
| 18 |
code => "200", |
| 19 |
msg => "Dontcare", |
| 20 |
headers => { |
| 21 |
"Content-type" => "text/html", |
| 22 |
}, |
| 23 |
content => $dummyfile |
| 24 |
}, |
| 25 |
); |
| 26 |
|
| 27 |
my $cmdline = $WgetTest::WGETPATH . " --quiet -O out http://localhost:{{port}}/nonexistent"; |
| 28 |
|
| 29 |
my $expected_error_code = 8; |
| 30 |
|
| 31 |
my %expected_downloaded_files = ( |
| 32 |
'out' => { |
| 33 |
content => "", |
| 34 |
} |
| 35 |
); |
| 36 |
|
| 37 |
############################################################################### |
| 38 |
|
| 39 |
my $the_test = HTTPTest->new (input => \%urls, |
| 40 |
cmdline => $cmdline, |
| 41 |
errcode => $expected_error_code, |
| 42 |
output => \%expected_downloaded_files); |
| 43 |
exit $the_test->run(); |
| 44 |
|
| 45 |
# vim: et ts=4 sw=4 |