]> sjero.net Git - wget/blob - tests/Test-N-HTTP-Content-Disposition.px
Merge build info with head.
[wget] / tests / Test-N-HTTP-Content-Disposition.px
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 use HTTPTest;
6
7
8 ###############################################################################
9
10 my $dummyfile = <<EOF;
11 Don't care.
12 EOF
13
14 # code, msg, headers, content
15 my %urls = (
16     '/dummy.txt' => {
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             "Content-Disposition" => "attachment; filename=\"filename.txt\"",
23         },
24         content => $dummyfile
25     },
26 );
27
28 my $cmdline = $WgetTest::WGETPATH . " -N --content-disposition "
29               . "http://localhost:{{port}}/dummy.txt";
30
31 my $expected_error_code = 0;
32
33 my %expected_downloaded_files = (
34     'filename.txt' => {
35         content => $dummyfile,
36         timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
37     }
38 );
39
40 ###############################################################################
41
42 my $the_test = HTTPTest->new (name => "Test-N-HTTP-Content-Disposition",
43                               input => \%urls, 
44                               cmdline => $cmdline, 
45                               errcode => $expected_error_code, 
46                               output => \%expected_downloaded_files);
47 exit $the_test->run();
48
49 # vim: et ts=4 sw=4
50