~ubuntu-branches/ubuntu/maverick/wget/maverick

« back to all changes in this revision

Viewing changes to tests/Test-Restrict-Lowercase.px

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-05-27 11:49:54 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080527114954-ame070pjhqtofeaf
Tags: 1.11.2-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>Some Page Title</title>
 
14
</head>
 
15
<body>
 
16
  <p>
 
17
    Some text...
 
18
  </p>
 
19
</body>
 
20
</html>
 
21
EOF
 
22
 
 
23
# code, msg, headers, content
 
24
my %urls = (
 
25
    '/SomePage.html' => {
 
26
        code => "200",
 
27
        msg => "Dontcare",
 
28
        headers => {
 
29
            "Content-type" => "text/html",
 
30
        },
 
31
        content => $mainpage,
 
32
    },
 
33
);
 
34
 
 
35
my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=lowercase http://localhost:8080/SomePage.html";
 
36
 
 
37
my $expected_error_code = 0;
 
38
 
 
39
my %expected_downloaded_files = (
 
40
    'somepage.html' => {
 
41
        content => $mainpage,
 
42
    },
 
43
);
 
44
 
 
45
###############################################################################
 
46
 
 
47
my $the_test = HTTPTest->new (name => "Test-Restrict-Lowercase",
 
48
                              input => \%urls, 
 
49
                              cmdline => $cmdline, 
 
50
                              errcode => $expected_error_code, 
 
51
                              output => \%expected_downloaded_files);
 
52
exit $the_test->run();
 
53
 
 
54
# vim: et ts=4 sw=4
 
55