]> sjero.net Git - wget/commitdiff
Test-idn-cmd.px.
authorMicah Cowan <micah@cowan.name>
Wed, 10 Sep 2008 04:55:02 +0000 (21:55 -0700)
committerMicah Cowan <micah@cowan.name>
Wed, 10 Sep 2008 04:55:02 +0000 (21:55 -0700)
tests/ChangeLog
tests/Test-idn-cmd.px [new file with mode: 0755]
tests/run-px

index 867a82ec816a1d6f1695c878c2dec06faeda6fa5..7751be64bd15dfba3d5f5cb946f795516a35765a 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-09  Micah Cowan  <micah@cowan.name>
+
+       * Test-idn-cmd.px: Added.
+
+       * run-px: Added Test-idn-cmd.px.
+
 2008-08-28  Micah Cowan  <micah@cowan.name>
 
        * 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 (executable)
index 0000000..a5c156a
--- /dev/null
@@ -0,0 +1,50 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+use HTTPTest;
+
+# " Kon'nichiwa <dot> 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 = <<EOF;
+Found me!
+EOF
+
+# code, msg, headers, content
+my %urls = (
+    "http://$punycoded_hostname/index.html" => {
+        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
+
index 50f3321877e34f5253f427c1370df80b52539993..3852071406af3b0b020bc78ac8675e66349ac4f7 100755 (executable)
@@ -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',