From 523c3dfcbc3e6858ea94288554d67d3c1208a7c1 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Tue, 9 Sep 2008 21:55:02 -0700 Subject: [PATCH] Test-idn-cmd.px. --- tests/ChangeLog | 6 ++++++ tests/Test-idn-cmd.px | 50 +++++++++++++++++++++++++++++++++++++++++++ tests/run-px | 1 + 3 files changed, 57 insertions(+) create mode 100755 tests/Test-idn-cmd.px diff --git a/tests/ChangeLog b/tests/ChangeLog index 867a82ec..7751be64 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2008-09-09 Micah Cowan + + * Test-idn-cmd.px: Added. + + * run-px: Added Test-idn-cmd.px. + 2008-08-28 Micah Cowan * HTTPServer.pm (run): Allow distinguishing between hostnames, diff --git a/tests/Test-idn-cmd.px b/tests/Test-idn-cmd.px new file mode 100755 index 00000000..a5c156a2 --- /dev/null +++ b/tests/Test-idn-cmd.px @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +use strict; + +use HTTPTest; + +# " Kon'nichiwa Japan +my $euc_jp_hostname = "\272\243\306\374\244\317.\306\374\313\334"; +my $punycoded_hostname = 'xn--v9ju72g90p.xn--wgv71a'; + +############################################################################### + +my $result_file = < { + code => "200", + msg => "Yes, please", + headers => { + 'Content-Type' => 'text/plain', + }, + content => $result_file, + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --debug --iri -rH" + . " -e http_proxy=localhost:{{port}} --locale=EUC-JP $euc_jp_hostname"; + +my $expected_error_code = 0; + +my %expected_downloaded_files = ( + "$punycoded_hostname/index.html" => { + content => $result_file, + }, +); + +############################################################################### + +my $the_test = HTTPTest->new (name => "Test-iri-cmd", + input => \%urls, + cmdline => $cmdline, + errcode => $expected_error_code, + output => \%expected_downloaded_files); +exit $the_test->run(); + +# vim: et ts=4 sw=4 + diff --git a/tests/run-px b/tests/run-px index 50f33218..38520714 100755 --- a/tests/run-px +++ b/tests/run-px @@ -25,6 +25,7 @@ my @tests = ( 'Test-HTTP-Content-Disposition.px', 'Test-idn-headers.px', 'Test-idn-meta.px', + 'Test-idn-cmd.px', 'Test-iri.px', 'Test-iri-disabled.px', 'Test-iri-forced-remote.px', -- 2.39.2