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

« back to all changes in this revision

Viewing changes to tests/Test-N-smaller.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
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use HTTPTest;
 
7
 
 
8
 
 
9
###############################################################################
 
10
 
 
11
my $currentversion = <<EOF;
 
12
11111111111111111111111111111111111111111111111111
 
13
222222222222222222222222222222222222222222222222222222222222
 
14
3333333333333333333333333333333333333333333333333333333333333333333333
 
15
444444444444444444444444444444444444444444444444444444444444
 
16
55555555555555555555555555555555555555555555555555
 
17
EOF
 
18
 
 
19
my $newversion = <<EOF;
 
20
11111111111111111111111111111111111111111111111111
 
21
222222222222222222222222222222222222222222222222222222222222
 
22
EOF
 
23
 
 
24
# code, msg, headers, content
 
25
my %urls = (
 
26
    '/somefile.txt' => {
 
27
        code => "200",
 
28
        msg => "Dontcare",
 
29
        headers => {
 
30
            "Content-type" => "text/plain",
 
31
            "Content-Length" => length $newversion,
 
32
            "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
 
33
        },
 
34
        content => $newversion,
 
35
    },
 
36
);
 
37
 
 
38
my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt";
 
39
 
 
40
my $expected_error_code = 0;
 
41
 
 
42
my %existing_files = (
 
43
    'somefile.txt' => {
 
44
        content => $currentversion,
 
45
        timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
 
46
    },
 
47
);
 
48
 
 
49
my %expected_downloaded_files = (
 
50
    'somefile.txt' => {
 
51
        content => $newversion,
 
52
        timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
 
53
    },
 
54
);
 
55
 
 
56
###############################################################################
 
57
 
 
58
my $the_test = HTTPTest->new (name => "Test-N-current",
 
59
                              input => \%urls,
 
60
                              cmdline => $cmdline,
 
61
                              errcode => $expected_error_code,
 
62
                              existing => \%existing_files,
 
63
                              output => \%expected_downloaded_files);
 
64
exit $the_test->run();
 
65
 
 
66
# vim: et ts=4 sw=4
 
67