]> sjero.net Git - wget/blobdiff - tests/Test-np.px
Fix build when libpsl is not available
[wget] / tests / Test-np.px
index 09b77da4cc5321bb2b4e70ef474a6e639a660f31..4afc27c6fdc75b1b051fe9e3d560f53a91694b82 100755 (executable)
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 use strict;
+use warnings;
 
 use HTTPTest;
 
@@ -14,7 +15,7 @@ my $mainpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/firstlevel/secondpage.html">second page</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/firstlevel/secondpage.html">second page</a>.
   </p>
 </body>
 </html>
@@ -27,7 +28,7 @@ my $secondpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/firstlevel/lowerlevel/thirdpage.html">third page</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/firstlevel/lowerlevel/thirdpage.html">third page</a>.
   </p>
 </body>
 </html>
@@ -40,7 +41,7 @@ my $thirdpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/higherlevelpage.html">higher level page</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/higherlevelpage.html">higher level page</a>.
   </p>
 </body>
 </html>
@@ -54,7 +55,7 @@ my $fourthpage = <<EOF;
 <body>
   <p>
     This page is only linked by the higher level page. Therefore, it should not
-    be downloaded. 
+    be downloaded.
   </p>
 </body>
 </html>
@@ -68,8 +69,8 @@ my $higherlevelpage = <<EOF;
 <body>
   <p>
     This page is on a higher level in the URL path hierarchy. Therefore, it
-    should not be downloaded. Wget should not visit the following link to a 
-    <a href="http://localhost:8080/firstlevel/fourthpage.html">fourth page</a>.
+    should not be downloaded. Wget should not visit the following link to a
+    <a href="http://localhost:{{port}}/firstlevel/fourthpage.html">fourth page</a>.
   </p>
 </body>
 </html>
@@ -77,7 +78,7 @@ EOF
 
 # code, msg, headers, content
 my %urls = (
-    'firstlevel/index.html' => {
+    '/firstlevel/index.html' => {
         code => "200",
         msg => "Dontcare",
         headers => {
@@ -85,7 +86,7 @@ my %urls = (
         },
         content => $mainpage,
     },
-    'firstlevel/secondpage.html' => {
+    '/firstlevel/secondpage.html' => {
         code => "200",
         msg => "Dontcare",
         headers => {
@@ -93,7 +94,7 @@ my %urls = (
         },
         content => $secondpage,
     },
-    'firstlevel/lowerlevel/thirdpage.html' => {
+    '/firstlevel/lowerlevel/thirdpage.html' => {
         code => "200",
         msg => "Dontcare",
         headers => {
@@ -101,7 +102,7 @@ my %urls = (
         },
         content => $thirdpage,
     },
-    'firstlevel/fourthpage.html' => {
+    '/firstlevel/fourthpage.html' => {
         code => "200",
         msg => "Dontcare",
         headers => {
@@ -109,7 +110,7 @@ my %urls = (
         },
         content => $fourthpage,
     },
-    'higherlevelpage.html' => {
+    '/higherlevelpage.html' => {
         code => "200",
         msg => "Dontcare",
         headers => {
@@ -119,7 +120,7 @@ my %urls = (
     },
 );
 
-my $cmdline = "wget -np -nH -r http://localhost:8080/firstlevel/";
+my $cmdline = $WgetTest::WGETPATH . " -np -nH -r http://localhost:{{port}}/firstlevel/";
 
 my $expected_error_code = 0;
 
@@ -138,11 +139,11 @@ my %expected_downloaded_files = (
 ###############################################################################
 
 my $the_test = HTTPTest->new (name => "Test-np",
-                              input => \%urls, 
-                              cmdline => $cmdline, 
-                              errcode => $expected_error_code, 
+                              input => \%urls,
+                              cmdline => $cmdline,
+                              errcode => $expected_error_code,
                               output => \%expected_downloaded_files);
-$the_test->run();
+exit $the_test->run();
 
 # vim: et ts=4 sw=4