9 ###############################################################################
14 <title>Main Page</title>
18 Some text and a link to a <a href="http://localhost:{{port}}/firstlevel/secondpage.html">second page</a>.
24 my $secondpage = <<EOF;
27 <title>Second Page</title>
31 Some text and a link to a <a href="http://localhost:{{port}}/firstlevel/lowerlevel/thirdpage.html">third page</a>.
37 my $thirdpage = <<EOF;
40 <title>Third Page</title>
44 Some text and a link to a <a href="http://localhost:{{port}}/higherlevelpage.html">higher level page</a>.
50 my $fourthpage = <<EOF;
53 <title>Fourth Page</title>
57 This page is only linked by the higher level page. Therefore, it should not
64 my $higherlevelpage = <<EOF;
67 <title>Higher Level Page</title>
71 This page is on a higher level in the URL path hierarchy. Therefore, it
72 should not be downloaded. Wget should not visit the following link to a
73 <a href="http://localhost:{{port}}/firstlevel/fourthpage.html">fourth page</a>.
79 # code, msg, headers, content
81 '/firstlevel/index.html' => {
85 "Content-type" => "text/html",
89 '/firstlevel/secondpage.html' => {
93 "Content-type" => "text/html",
95 content => $secondpage,
97 '/firstlevel/lowerlevel/thirdpage.html' => {
101 "Content-type" => "text/html",
103 content => $thirdpage,
105 '/firstlevel/fourthpage.html' => {
109 "Content-type" => "text/plain",
111 content => $fourthpage,
113 '/higherlevelpage.html' => {
117 "Content-type" => "text/plain",
119 content => $higherlevelpage,
123 my $cmdline = $WgetTest::WGETPATH . " -np -nH -r http://localhost:{{port}}/firstlevel/";
125 my $expected_error_code = 0;
127 my %expected_downloaded_files = (
128 'firstlevel/index.html' => {
129 content => $mainpage,
131 'firstlevel/secondpage.html' => {
132 content => $secondpage,
134 'firstlevel/lowerlevel/thirdpage.html' => {
135 content => $thirdpage,
139 ###############################################################################
141 my $the_test = HTTPTest->new (name => "Test-np",
144 errcode => $expected_error_code,
145 output => \%expected_downloaded_files);
146 exit $the_test->run();