]> sjero.net Git - wget/blobdiff - tests/Test--spider-r.px
NEWS: cite --start-pos
[wget] / tests / Test--spider-r.px
old mode 100644 (file)
new mode 100755 (executable)
index 94ca2c7..b84bafb
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 use strict;
+use warnings;
 
 use HTTPTest;
 
@@ -14,8 +15,8 @@ my $mainpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/secondpage.html">second page</a>.
-    Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/secondpage.html">second page</a>.
+    Also, a <a href="http://localhost:{{port}}/nonexistent">broken link</a>.
   </p>
 </body>
 </html>
@@ -28,8 +29,8 @@ my $secondpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/thirdpage.html">third page</a>.
-    Also, a <a href="http://localhost:8080/nonexistent">broken link</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/thirdpage.html">third page</a>.
+    Also, a <a href="http://localhost:{{port}}/nonexistent">broken link</a>.
   </p>
 </body>
 </html>
@@ -42,8 +43,8 @@ my $thirdpage = <<EOF;
 </head>
 <body>
   <p>
-    Some text and a link to a <a href="http://localhost:8080/dummy.txt">text file</a>.
-    Also, another <a href="http://localhost:8080/againnonexistent">broken link</a>.
+    Some text and a link to a <a href="http://localhost:{{port}}/dummy.txt">text file</a>.
+    Also, another <a href="http://localhost:{{port}}/againnonexistent">broken link</a>.
   </p>
 </body>
 </html>
@@ -89,9 +90,9 @@ my %urls = (
     },
 );
 
-my $cmdline = "wget --spider -r http://localhost:8080/";
+my $cmdline = $WgetTest::WGETPATH . " --spider -r http://localhost:{{port}}/";
 
-my $expected_error_code = 0;
+my $expected_error_code = 8;
 
 my %expected_downloaded_files = (
 );
@@ -99,11 +100,11 @@ my %expected_downloaded_files = (
 ###############################################################################
 
 my $the_test = HTTPTest->new (name => "Test--spider-r",
-                              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