]> sjero.net Git - wget/blob - tests/Test-O--no-content-disposition.px
NEWS: cite --start-pos
[wget] / tests / Test-O--no-content-disposition.px
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5
6 use HTTPTest;
7
8
9 ###############################################################################
10
11 my $dummyfile = <<EOF;
12 Don't care.
13 EOF
14
15 # code, msg, headers, content
16 my %urls = (
17     '/dummy.txt' => {
18         code => "200",
19         msg => "Dontcare",
20         headers => {
21             "Content-type" => "text/plain",
22             "Content-Disposition" => "attachment; filename=\"filename.txt\"",
23         },
24         content => $dummyfile
25     },
26 );
27
28 my $cmdline = $WgetTest::WGETPATH . " -O out --no-content-disposition http://localhost:{{port}}/dummy.txt";
29
30 my $expected_error_code = 0;
31
32 my %expected_downloaded_files = (
33     'out' => {
34         content => $dummyfile,
35     }
36 );
37
38 ###############################################################################
39
40 my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition",
41                               input => \%urls,
42                               cmdline => $cmdline,
43                               errcode => $expected_error_code,
44                               output => \%expected_downloaded_files);
45 exit $the_test->run();
46
47 # vim: et ts=4 sw=4
48