This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #127663) work around what appears to be a freebsd bug
[perl5.git] / t / run / switches.t
index 6725f8f..651e45d 100644 (file)
@@ -12,7 +12,7 @@ BEGIN {
 
 BEGIN { require "./test.pl";  require "./loc_tools.pl"; }
 
-plan(tests => 136);
+plan(tests => 137);
 
 use Config;
 
@@ -552,6 +552,19 @@ CODE
         rmdir "$work.bak" or die "Cannot remove mask backup directory: $!";
     }
 
+    {
+        # test with absolute paths, this was failing on FreeBSD 11ish due
+        # to a bug in renameat()
+        my $abs_work = File::Spec->rel2abs($work);
+        fresh_perl_is(<<'CODE', "",
+while (<>) {
+  print;
+}
+CODE
+                      { stderr => 1, args => [ $abs_work ], switches => [ "-i" ] },
+                      "abs paths");
+    }
+
     # we now use temp files for in-place editing, make sure we didn't leave
     # any behind in the above test
     opendir my $d, "inplacetmp" or die "Cannot opendir inplacetmp: $!";