]> sjero.net Git - wget/blob - tests/Test2.px
4473a44ac22fa948f3a0bc52a7bf40d4054771d5
[wget] / tests / Test2.px
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use HTTPTest;
6
7
8 ###############################################################################
9
10 my $dummyfile = <<EOF;
11 Content
12 EOF
13
14 # code, msg, headers, content
15 my %urls = (
16     '/dummy.html' => {
17         code => "200",
18         msg => "Dontcare",
19         headers => {
20             "Content-type" => "text/plain",
21             "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
22         },
23         content => $dummyfile
24     },
25 );
26
27 my $cmdline = "../src/wget -vd -N http://localhost:8080/dummy.html";
28
29 my $expected_error_code = 0;
30
31 my %expected_downloaded_files = (
32     'dummy.html' => {
33         content => $dummyfile,
34         timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
35     }
36 );
37
38 ###############################################################################
39
40 my $the_test = HTTPTest->new (urls => \%urls, 
41                               cmdline => $cmdline, 
42                               errcode => $expected_error_code, 
43                               downloads => \%expected_downloaded_files);
44 $the_test->run();
45
46 # vim: et ts=4 sw=4
47