X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=tests%2FTest--spider-r-HTTP-Content-Disposition.px;fp=tests%2FTest--spider-r-HTTP-Content-Disposition.px;h=e70f6b409282015203aabe6bb812c962b898302b;hb=6e3d978b8bca9b9b3408590e9733d5c93cf90f6d;hp=0000000000000000000000000000000000000000;hpb=43583130693fd7befaf182b9ef348716b17a185b;p=wget diff --git a/tests/Test--spider-r-HTTP-Content-Disposition.px b/tests/Test--spider-r-HTTP-Content-Disposition.px new file mode 100755 index 00000000..e70f6b40 --- /dev/null +++ b/tests/Test--spider-r-HTTP-Content-Disposition.px @@ -0,0 +1,110 @@ +#!/usr/bin/perl -w + +use strict; + +use HTTPTest; + + +############################################################################### + +my $mainpage = < + + Main Page + + +

+ Some text and a link to a second page. + Also, a broken link. +

+ + +EOF + +my $secondpage = < + + Second Page + + +

+ Some text and a link to a third page. + Also, a broken link. +

+ + +EOF + +my $thirdpage = < + + Third Page + + +

+ Some text and a link to a text file. + Also, another broken link. +

+ + +EOF + +my $dummyfile = < { + code => "200", + msg => "Dontcare", + headers => { + "Content-type" => "text/html", + }, + content => $mainpage, + }, + '/secondpage.html' => { + code => "200", + msg => "Dontcare", + headers => { + "Content-type" => "text/html", + "Content-Disposition" => "attachment; filename=\"filename.html\"", + }, + content => $secondpage, + }, + '/thirdpage.html' => { + code => "200", + msg => "Dontcare", + headers => { + "Content-type" => "text/html", + }, + content => $thirdpage, + }, + '/dummy.txt' => { + code => "200", + msg => "Dontcare", + headers => { + "Content-type" => "text/plain", + }, + content => $dummyfile + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --spider -r http://localhost:8080/"; + +my $expected_error_code = 0; + +my %expected_downloaded_files = ( +); + +############################################################################### + +my $the_test = HTTPTest->new (name => "Test--spider-r-HTTP-Content-Disposition", + input => \%urls, + cmdline => $cmdline, + errcode => $expected_error_code, + output => \%expected_downloaded_files); +exit $the_test->run(); + +# vim: et ts=4 sw=4 +