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";
+}