Initail import package wget: A utility for retrieving files using the HTTP or FTP...
[external/wget.git] / tests / Test-Restrict-Uppercase.px
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use HTTPTest;
7
8
9 ###############################################################################
10
11 my $mainpage = <<EOF;
12 <html>
13 <head>
14   <title>Some Page Title</title>
15 </head>
16 <body>
17   <p>
18     Some text...
19   </p>
20 </body>
21 </html>
22 EOF
23
24 # code, msg, headers, content
25 my %urls = (
26     '/SomePage.html' => {
27         code => "200",
28         msg => "Dontcare",
29         headers => {
30             "Content-type" => "text/html",
31         },
32         content => $mainpage,
33     },
34 );
35
36 my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=uppercase http://localhost:{{port}}/SomePage.html";
37
38 my $expected_error_code = 0;
39
40 my %expected_downloaded_files = (
41     'SOMEPAGE.HTML' => {
42         content => $mainpage,
43     },
44 );
45
46 ###############################################################################
47
48 my $the_test = HTTPTest->new (name => "Test-Restrict-Uppercase",
49                               input => \%urls,
50                               cmdline => $cmdline,
51                               errcode => $expected_error_code,
52                               output => \%expected_downloaded_files);
53 exit $the_test->run();
54
55 # vim: et ts=4 sw=4
56