]> sjero.net Git - wget/blob - tests/Test-idn-cmd.px
Attempted, but failed, to reproduce bug 22403.
[wget] / tests / Test-idn-cmd.px
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use WgetFeature qw(iri);
7 use HTTPTest;
8
9 # " Kon'nichiwa <dot> Japan
10 my $euc_jp_hostname = "\272\243\306\374\244\317.\306\374\313\334";
11 my $punycoded_hostname = 'xn--v9ju72g90p.xn--wgv71a';
12
13 ###############################################################################
14
15 my $result_file = <<EOF;
16 Found me!
17 EOF
18
19 # code, msg, headers, content
20 my %urls = (
21     "http://$punycoded_hostname/index.html" => {
22         code => "200",
23         msg => "Yes, please",
24         headers => {
25             'Content-Type' => 'text/plain',
26         },
27         content => $result_file,
28     },
29 );
30
31 my $cmdline = $WgetTest::WGETPATH . " --debug --iri -rH"
32     . " -e http_proxy=localhost:{{port}} --local-encoding=EUC-JP $euc_jp_hostname";
33
34 my $expected_error_code = 0;
35
36 my %expected_downloaded_files = (
37     "$punycoded_hostname/index.html" => {
38         content => $result_file,
39     },
40 );
41
42 ###############################################################################
43
44 my $the_test = HTTPTest->new (name => "Test-idn-cmd",
45                               input => \%urls, 
46                               cmdline => $cmdline, 
47                               errcode => $expected_error_code, 
48                               output => \%expected_downloaded_files);
49 exit $the_test->run();
50
51 # vim: et ts=4 sw=4
52