]> sjero.net Git - wget/blob - tests/Test-O-HTTP-Content-Disposition.px
Automated merge with file:/home/micah/devel/wget/eleven
[wget] / tests / Test-O-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             "Content-Disposition" => "attachment; filename=\"filename.txt\"",
22         },
23         content => $dummyfile
24     },
25 );
26
27 my $cmdline = $WgetTest::WGETPATH . " -O out http://localhost:8080/dummy.txt";
28
29 my $expected_error_code = 0;
30
31 my %expected_downloaded_files = (
32     'out' => {
33         content => $dummyfile,
34     }
35 );
36
37 ###############################################################################
38
39 my $the_test = HTTPTest->new (name => "Test-O-HTTP-Content-Disposition",
40                               input => \%urls, 
41                               cmdline => $cmdline, 
42                               errcode => $expected_error_code, 
43                               output => \%expected_downloaded_files);
44 exit $the_test->run();
45
46 # vim: et ts=4 sw=4
47