1#!/usr/bin/env perl 2 3use strict; 4use warnings; 5 6use HTTPTest; 7 8 9############################################################################### 10 11my $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> 22EOF 23 24# code, msg, headers, content 25my %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 37my $cmdline = $WgetTest::WGETPATH . " -e contentdisposition=on http://localhost:{{port}}/dummy.html"; 38 39my $expected_error_code = 0; 40 41my %expected_downloaded_files = ( 42 'filename.html' => { 43 content => $dummyfile, 44 } 45); 46 47############################################################################### 48 49my $the_test = HTTPTest->new (input => \%urls, 50 cmdline => $cmdline, 51 errcode => $expected_error_code, 52 output => \%expected_downloaded_files); 53exit $the_test->run(); 54 55# vim: et ts=4 sw=4 56