~ubuntu-branches/ubuntu/trusty/wget/trusty-updates

« back to all changes in this revision

Viewing changes to tests/Test-N-current.px

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2009-12-12 08:15:59 UTC
  • mfrom: (2.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091212081559-mvccl4kzdqb138y3
Tags: 1.12-1.1ubuntu1
* Merge from debian testing, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
* Keep build dependencies in main:
  - debian/control: remove info2man build-dep
  - debian/patches/00list: disable wget-infopod_generated_manpage.dpatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
 
1
#!/usr/bin/perl
2
2
 
3
3
use strict;
 
4
use warnings;
4
5
 
5
6
use HTTPTest;
6
7
 
15
16
55555555555555555555555555555555555555555555555555
16
17
EOF
17
18
 
 
19
# The server should serve a slightly different content, but with the
 
20
# same length, so we can test which version was downloaded.
 
21
my $modifiedversion = $currentversion;
 
22
$modifiedversion =~ s/^(.{20}).(.*)$/$1x$2/s;
 
23
 
18
24
# code, msg, headers, content
19
25
my %urls = (
20
26
    '/somefile.txt' => {
24
30
            "Content-type" => "text/plain",
25
31
            "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
26
32
        },
27
 
        content => $currentversion,
 
33
        content => $modifiedversion,
28
34
    },
29
35
);
30
36
 
31
 
my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:8080/somefile.txt";
 
37
my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt";
32
38
 
33
39
my $expected_error_code = 0;
34
40
 
49
55
###############################################################################
50
56
 
51
57
my $the_test = HTTPTest->new (name => "Test-N-current",
52
 
                              input => \%urls, 
53
 
                              cmdline => $cmdline, 
54
 
                              errcode => $expected_error_code, 
 
58
                              input => \%urls,
 
59
                              cmdline => $cmdline,
 
60
                              errcode => $expected_error_code,
55
61
                              existing => \%existing_files,
56
62
                              output => \%expected_downloaded_files);
57
63
exit $the_test->run();