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