]> sjero.net Git - wget/blob - tests/Test8.px
[svn] Added support for --restrict-file-names=lowercase and --restrict-file-names...
[wget] / tests / Test8.px
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use HTTPTest;
6
7
8 ###############################################################################
9
10 my $mainpage = <<EOF;
11 <html>
12 <head>
13   <title>Main Page Title</title>
14 </head>
15 <body>
16   <a href="http://localhost:8080/subpage.html">Secondary Page</a>
17 </body>
18 </html>
19 EOF
20
21 my $subpage = <<EOF;
22 <html>
23 <head>
24   <title>Secondary Page Title</title>
25 </head>
26 <body>
27   <a href="http://localhost:8080/nonexistent">Broken Link</a>
28 </body>
29 </html>
30 EOF
31
32 # code, msg, headers, content
33 my %urls = (
34     '/index.html' => {
35         code => "200",
36         msg => "Dontcare",
37         headers => {
38             "Content-type" => "text/html",
39         },
40         content => $mainpage,
41     },
42     '/subpage.html' => {
43         code => "200",
44         msg => "Dontcare",
45         headers => {
46             "Content-type" => "text/html",
47         },
48         content => $subpage,
49     },
50 );
51
52 my $cmdline = "wget --spider -r http://localhost:8080/";
53
54 my $expected_error_code = 0;
55
56 my %expected_downloaded_files = (
57 );
58
59 ###############################################################################
60
61 my $the_test = HTTPTest->new (name => "Test8",
62                               input => \%urls, 
63                               cmdline => $cmdline, 
64                               errcode => $expected_error_code, 
65                               output => \%expected_downloaded_files);
66 $the_test->run();
67
68 # vim: et ts=4 sw=4
69