This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
If both ways to call semctl are broken, skip the tests.
[perl5.git] / t / lib / filepath.t
old mode 100644 (file)
new mode 100755 (executable)
index c014f74..40e6e21
@@ -2,19 +2,27 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = '../lib';
+    unshift @INC, '../lib';
 }
 
-print "1..2\n";
-
 use File::Path;
+use strict;
+
+my $count = 0;
+$^W = 1;
 
-mkpath("foo/bar");
+print "1..4\n";
 
-print "not " unless -d "foo" && -d "foo/bar";
-print "ok 1\n";
+# first check for stupid permissions second for full, so we clean up
+# behind ourselves
+for my $perm (0111,0777) {
+    mkpath("foo/bar");
+    chmod $perm, "foo", "foo/bar";
 
-rmtree("foo");
+    print "not " unless -d "foo" && -d "foo/bar";
+    print "ok ", ++$count, "\n";
 
-print "not " if -e "foo";
-print "ok 2\n";
+    rmtree("foo");
+    print "not " if -e "foo";
+    print "ok ", ++$count, "\n";
+}