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

« back to all changes in this revision

Viewing changes to tests/Test-c-partial.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
 
9
10
 
10
11
my $partiallydownloaded = <<EOF;
11
12
11111111111111111111111111111111111111111111111111
12
 
222222222222222222222222222222222222222222222222222222222222
 
13
22222222x222222222222222222222222222222222222222222222222222
13
14
EOF
14
15
 
15
 
my $wholefile = <<EOF;
16
 
11111111111111111111111111111111111111111111111111
17
 
222222222222222222222222222222222222222222222222222222222222
 
16
my $rest = <<EOF;
18
17
3333333333333333333333333333333333333333333333333333333333333333333333
19
18
444444444444444444444444444444444444444444444444444444444444
20
19
55555555555555555555555555555555555555555555555555
21
20
EOF
22
21
 
 
22
my $wholefile = <<EOF . $rest;
 
23
11111111111111111111111111111111111111111111111111
 
24
222222222222222222222222222222222222222222222222222222222222
 
25
EOF
 
26
 
 
27
my $downloadedfile = $partiallydownloaded . $rest;
 
28
 
23
29
# code, msg, headers, content
24
30
my %urls = (
25
31
    '/somefile.txt' => {
32
38
    },
33
39
);
34
40
 
35
 
my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt";
 
41
my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt";
36
42
 
37
43
my $expected_error_code = 0;
38
44
 
44
50
 
45
51
my %expected_downloaded_files = (
46
52
    'somefile.txt' => {
47
 
        content => $wholefile,
 
53
        content => $downloadedfile,
48
54
    },
49
55
);
50
56
 
51
57
###############################################################################
52
58
 
53
59
my $the_test = HTTPTest->new (name => "Test-c-partial",
54
 
                              input => \%urls, 
55
 
                              cmdline => $cmdline, 
56
 
                              errcode => $expected_error_code, 
 
60
                              input => \%urls,
 
61
                              cmdline => $cmdline,
 
62
                              errcode => $expected_error_code,
57
63
                              existing => \%existing_files,
58
64
                              output => \%expected_downloaded_files);
59
65
exit $the_test->run();