[perl #115962] cwd.t: Add test for fast_abs_path in LF dir
authorFather Chrysostomos <sprout@cpan.org>
Mon, 3 Dec 2012 02:53:23 +0000 (18:53 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 3 Dec 2012 16:53:44 +0000 (08:53 -0800)
dist/Cwd/t/cwd.t

index c9a2187..f7b03ed 100644 (file)
@@ -36,7 +36,7 @@ if ($IsVMS) {
     $vms_mode = 0 if ($vms_unix_rpt);
 }
 
-my $tests = 30;
+my $tests = 31;
 # _perl_abs_path() currently only works when the directory separator
 # is '/', so don't test it when it won't work.
 my $EXTRA_ABSPATH_TESTS = ($Config{prefix} =~ m/\//) && $^O ne 'cygwin';
@@ -245,6 +245,16 @@ SKIP: {
     if $EXTRA_ABSPATH_TESTS;
 }
 
+SKIP: {
+  my $dir = "${$}a\nx";
+  mkdir $dir or skip "OS does not support dir names containing LF";
+  chdir $dir or skip "OS cannot chdir into LF";
+  eval { Cwd::fast_abs_path() };
+  is $@, "", 'fast_abs_path does not die in dir whose name contains LF';
+  chdir File::Spec->updir;
+  rmdir $dir;
+}
+
 
 #############################################
 # These routines give us sort of a poor-man's cross-platform