#!/usr/bin/env -S perl -I . use strict; use warnings; 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 => $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 --no-content-disposition http://localhost:{{port}}/"; my $expected_error_code = 8; my %expected_downloaded_files = ( ); ############################################################################### my $the_test = HTTPTest->new (input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files); exit $the_test->run(); # vim: et ts=4 sw=4