]> sjero.net Git - wget/commitdiff
FTP recursion test, when IRI is on.
authorMicah Cowan <micah@cowan.name>
Tue, 30 Jun 2009 01:53:13 +0000 (18:53 -0700)
committerMicah Cowan <micah@cowan.name>
Tue, 30 Jun 2009 01:53:13 +0000 (18:53 -0700)
tests/ChangeLog
tests/Test-ftp-iri-recursive.px [new file with mode: 0755]
tests/WgetTest.pm.in
tests/run-px

index ec66a34557c50abf1186bba4b908d84416afe496..6fd859c08bc86821125ff0eb58b84b7762840a6d 100644 (file)
@@ -1,7 +1,11 @@
 2009-06-29  Micah Cowan  <micah@cowan.name>
 
-       * 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  <micah@cowan.name> (not copyrightable)
 
diff --git a/tests/Test-ftp-iri-recursive.px b/tests/Test-ftp-iri-recursive.px
new file mode 100755 (executable)
index 0000000..95e9f31
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use FTPTest;
+
+
+###############################################################################
+
+my $ccedilla_l1 = "\xE7";
+my $ccedilla_u8 = "\xC3\xA7";
+
+my $francais = <<EOF;
+Some text.
+EOF
+
+$francais =~ s/\n/\r\n/;
+
+# code, msg, headers, content
+my %urls = (
+    "/fran${ccedilla_l1}ais.txt" => {
+        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
+
index 2e124e3c6d96a4c159d2b2414482136418d03376..5cd6769b8c0686d395c230ac9449fe341c7cca69 100644 (file)
@@ -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};
 }
 
 
index 64e35052c0a0e00704ea11838cce6c3edccf9b55..5faccb48c4c7f66e16e349610e8d31040c932546 100755 (executable)
@@ -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',