]> sjero.net Git - wget/blob - tests/Test--no-content-disposition.px
NEWS: cite --start-pos
[wget] / tests / Test--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 <html>
13 <head>
14   <title>Page Title</title>
15 </head>
16 <body>
17   <p>
18     Some text.
19   </p>
20 </body>
21 </html>
22 EOF
23
24 # code, msg, headers, content
25 my %urls = (
26     '/dummy.html' => {
27         code => "200",
28         msg => "Dontcare",
29         headers => {
30             "Content-type" => "text/html",
31             "Content-Disposition" => "attachment; filename=\"filename.html\"",
32         },
33         content => $dummyfile,
34     },
35 );
36
37 my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:{{port}}/dummy.html";
38
39 my $expected_error_code = 0;
40
41 my %expected_downloaded_files = (
42     'dummy.html' => {
43         content => $dummyfile,
44     }
45 );
46
47 ###############################################################################
48
49 my $the_test = HTTPTest->new (name => "Test--no-content-disposition",
50                               input => \%urls,
51                               cmdline => $cmdline,
52                               errcode => $expected_error_code,
53                               output => \%expected_downloaded_files);
54 exit $the_test->run();
55
56 # vim: et ts=4 sw=4
57