2005-11-02 09:27:23 -05:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
2005-12-05 08:35:07 -05:00
|
|
|
use HTTPTest;
|
|
|
|
|
|
|
|
|
2005-11-02 09:27:23 -05:00
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
my $dummyfile = <<EOF;
|
|
|
|
Content
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# code, msg, headers, content
|
|
|
|
my %urls = (
|
|
|
|
'/dummy.html' => {
|
|
|
|
code => "200",
|
|
|
|
msg => "Dontcare",
|
|
|
|
headers => {
|
|
|
|
"Content-type" => "text/plain",
|
|
|
|
},
|
|
|
|
content => $dummyfile
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
my $cmdline = "../src/wget http://localhost:8080/dummy.html";
|
2005-11-02 09:27:23 -05:00
|
|
|
|
|
|
|
my $expected_error_code = 0;
|
|
|
|
|
|
|
|
my %expected_downloaded_files = (
|
2005-12-05 08:35:07 -05:00
|
|
|
'dummy.html' => {
|
|
|
|
content => $dummyfile,
|
|
|
|
}
|
2005-11-02 09:27:23 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
my $the_test = HTTPTest->new (name => "Test1",
|
|
|
|
input => \%urls,
|
2005-12-05 08:35:07 -05:00
|
|
|
cmdline => $cmdline,
|
|
|
|
errcode => $expected_error_code,
|
2006-01-24 07:15:58 -05:00
|
|
|
output => \%expected_downloaded_files);
|
2005-12-05 08:35:07 -05:00
|
|
|
$the_test->run();
|
2005-11-02 09:27:23 -05:00
|
|
|
|
|
|
|
# vim: et ts=4 sw=4
|
|
|
|
|