This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
tests are expected to fail if dirfd () does not exist
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 18 Jul 2005 11:02:01 +0000 (11:02 +0000)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 18 Jul 2005 11:02:01 +0000 (11:02 +0000)
make the tests to expect failures in that case

p4raw-id: //depot/perl@25170

t/op/chdir.t

index 14024a6..3a00df2 100644 (file)
@@ -48,7 +48,14 @@ SKIP: {
     ok(open(my $fh, "<", "op"), "open op");
     ok(chdir($fh), "fchdir op");
     ok(-f "chdir.t", "verify that we are in op");
-    ok(chdir($dh), "fchdir back");
+    if (($Config{d_dirfd} || "") eq "define") {
+       ok(chdir($dh), "fchdir back");
+    }
+    else {
+       eval { chdir($dh); };
+       like($@, qr/^The dirfd function is unimplemented at/, "dirfd is unimplemented");
+       chdir "..";
+    }
     ok(-d "op", "verify that we are back");
 }