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