1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use HTTPTest;
7
8
9###############################################################################
10
11my $mainpage = <<EOF;
12<html>
13<head>
14  <title>Main Page</title>
15</head>
16<body>
17  <p>
18    Some text.
19  </p>
20</body>
21</html>
22EOF
23
24# code, msg, headers, content
25my %urls = (
26    '/index.html' => {
27        code => "200",
28        msg => "Dontcare",
29        headers => {
30            "Content-type" => "text/html",
31        },
32        content => $mainpage,
33    },
34);
35
36my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:{{port}}/nonexistent";
37
38my $expected_error_code = 8;
39
40my %expected_downloaded_files = (
41);
42
43###############################################################################
44
45my $the_test = HTTPTest->new (name => "Test--spider-fail",
46                              input => \%urls,
47                              cmdline => $cmdline,
48                              errcode => $expected_error_code,
49                              output => \%expected_downloaded_files);
50exit $the_test->run();
51
52# vim: et ts=4 sw=4
53
54