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