From 8d7c2219d1965fb1bda16d46bb45e8fe7dc60501 Mon Sep 17 00:00:00 2001 From: Xavier Saint Date: Sat, 2 Aug 2008 13:47:10 +0200 Subject: [PATCH] Test FTP IRI support --- tests/Test-ftp-iri-disabled.px | 50 ++++++++++++++++++++++++++++++++++ tests/Test-ftp-iri-fallback.px | 46 +++++++++++++++++++++++++++++++ tests/Test-ftp-iri.px | 47 ++++++++++++++++++++++++++++++++ tests/run-px | 3 ++ 4 files changed, 146 insertions(+) create mode 100755 tests/Test-ftp-iri-disabled.px create mode 100755 tests/Test-ftp-iri-fallback.px create mode 100755 tests/Test-ftp-iri.px diff --git a/tests/Test-ftp-iri-disabled.px b/tests/Test-ftp-iri-disabled.px new file mode 100755 index 00000000..14d849da --- /dev/null +++ b/tests/Test-ftp-iri-disabled.px @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +use strict; + +use FTPTest; + + +############################################################################### + +my $ccedilla_l1 = "\xE7"; +my $ccedilla_u8 = "\xC3\xA7"; + +my $francais = < { + content => $francais, + }, + "/fran${ccedilla_l1}ais.txt" => { + content => $francais, + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --iri=no --locale=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; + +my $expected_error_code = 0; + +my %expected_downloaded_files = ( + "fran${ccedilla_l1}ais.txt" => { + content => $francais, + }, +); + +############################################################################### + +my $the_test = FTPTest->new (name => "Test-ftp-iri", + 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/Test-ftp-iri-fallback.px b/tests/Test-ftp-iri-fallback.px new file mode 100755 index 00000000..8902e0f9 --- /dev/null +++ b/tests/Test-ftp-iri-fallback.px @@ -0,0 +1,46 @@ +#!/usr/bin/perl -w + +use strict; + +use FTPTest; + + +############################################################################### + +my $ccedilla_l1 = "\xE7"; +my $ccedilla_u8 = "\xC3\xA7"; + +my $francais = < { + content => $francais, + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --locale=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; + +my $expected_error_code = 0; + +my %expected_downloaded_files = ( + "fran${ccedilla_l1}ais.txt" => { + content => $francais, + }, +); + +############################################################################### + +my $the_test = FTPTest->new (name => "Test-ftp-iri", + 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/Test-ftp-iri.px b/tests/Test-ftp-iri.px new file mode 100755 index 00000000..d453669c --- /dev/null +++ b/tests/Test-ftp-iri.px @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w + +use strict; + +use FTPTest; + + +############################################################################### + +my $ccedilla_l1 = "\xE7"; +my $ccedilla_u8 = "\xC3\xA7"; + +my $francais = < { + content => $francais, + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --locale=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; + +my $expected_error_code = 0; + +my %expected_downloaded_files = ( + "fran${ccedilla_u8}ais.txt" => { + content => $francais, + }, +); + +############################################################################### + +my $the_test = FTPTest->new (name => "Test-ftp-iri", + 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 865246e3..172adcd7 100755 --- a/tests/run-px +++ b/tests/run-px @@ -16,6 +16,9 @@ my @tests = ( 'Test-E-k-K.px', 'Test-E-k.px', 'Test-ftp.px', + 'Test-ftp-iri.px', + 'Test-ftp-iri-fallback.px', + 'Test-ftp-iri-disabled.px', 'Test-HTTP-Content-Disposition-1.px', 'Test-HTTP-Content-Disposition-2.px', 'Test-HTTP-Content-Disposition.px', -- 2.39.2