]> sjero.net Git - wget/blob - tests/Test-c-partial.px
Catch failures in Test-N-current.px.
[wget] / tests / Test-c-partial.px
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use HTTPTest;
6
7
8 ###############################################################################
9
10 my $partiallydownloaded = <<EOF;
11 11111111111111111111111111111111111111111111111111
12 222222222222222222222222222222222222222222222222222222222222
13 EOF
14
15 my $wholefile = <<EOF;
16 11111111111111111111111111111111111111111111111111
17 222222222222222222222222222222222222222222222222222222222222
18 3333333333333333333333333333333333333333333333333333333333333333333333
19 444444444444444444444444444444444444444444444444444444444444
20 55555555555555555555555555555555555555555555555555
21 EOF
22
23 # code, msg, headers, content
24 my %urls = (
25     '/somefile.txt' => {
26         code => "200",
27         msg => "Dontcare",
28         headers => {
29             "Content-type" => "text/plain",
30         },
31         content => $wholefile,
32     },
33 );
34
35 my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:8080/somefile.txt";
36
37 my $expected_error_code = 0;
38
39 my %existing_files = (
40     'somefile.txt' => {
41         content => $partiallydownloaded,
42     },
43 );
44
45 my %expected_downloaded_files = (
46     'somefile.txt' => {
47         content => $wholefile,
48     },
49 );
50
51 ###############################################################################
52
53 my $the_test = HTTPTest->new (name => "Test-c-partial",
54                               input => \%urls, 
55                               cmdline => $cmdline, 
56                               errcode => $expected_error_code, 
57                               existing => \%existing_files,
58                               output => \%expected_downloaded_files);
59 exit $the_test->run();
60
61 # vim: et ts=4 sw=4
62