From 901343828bf794497df465a1fc6a94e3d6614433 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Mon, 29 Jun 2009 18:53:13 -0700 Subject: [PATCH] FTP recursion test, when IRI is on. --- tests/ChangeLog | 8 ++++-- tests/Test-ftp-iri-recursive.px | 47 +++++++++++++++++++++++++++++++++ tests/WgetTest.pm.in | 2 +- tests/run-px | 1 + 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100755 tests/Test-ftp-iri-recursive.px diff --git a/tests/ChangeLog b/tests/ChangeLog index ec66a345..6fd859c0 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,7 +1,11 @@ 2009-06-29 Micah Cowan - * run-px, Test-iri-percent.px: Added test for percent-coded value - preservation. + * WgetTest.pm.in (_cleanup): Allow cleanup of test directories to + be skipped at user discretion. + + * run-px, Test-iri-percent.px, Test-ftp-iri-recursive.px: Added + test for percent-coded value preservation, FTP recursion when IRI + support's on. 2008-12-04 Micah Cowan (not copyrightable) diff --git a/tests/Test-ftp-iri-recursive.px b/tests/Test-ftp-iri-recursive.px new file mode 100755 index 00000000..95e9f312 --- /dev/null +++ b/tests/Test-ftp-iri-recursive.px @@ -0,0 +1,47 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use FTPTest; + + +############################################################################### + +my $ccedilla_l1 = "\xE7"; +my $ccedilla_u8 = "\xC3\xA7"; + +my $francais = < { + content => $francais, + }, +); + +my $cmdline = $WgetTest::WGETPATH . " --locale=iso-8859-1 -r -nH -S ftp://localhost:{{port}}/"; + +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-recursive", + 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/WgetTest.pm.in b/tests/WgetTest.pm.in index 2e124e3c..5cd6769b 100644 --- a/tests/WgetTest.pm.in +++ b/tests/WgetTest.pm.in @@ -153,7 +153,7 @@ sub _cleanup { my $self = shift; chdir ($self->{_workdir}); - File::Path::rmtree ($self->{_name}); + File::Path::rmtree ($self->{_name}) unless $ENV{WGET_TEST_NO_CLEANUP}; } diff --git a/tests/run-px b/tests/run-px index 64e35052..5faccb48 100755 --- a/tests/run-px +++ b/tests/run-px @@ -27,6 +27,7 @@ my @tests = ( 'Test-ftp.px', 'Test-ftp-iri.px', 'Test-ftp-iri-fallback.px', + 'Test-ftp-iri-recursive.px', 'Test-ftp-iri-disabled.px', 'Test-HTTP-Content-Disposition-1.px', 'Test-HTTP-Content-Disposition-2.px', -- 2.39.2