1#!./perl -wT
2
3BEGIN {
4    chdir 't' if -d 't';
5    @INC = '../lib';
6}
7
8use File::Path;
9use File::Spec::Functions;
10use strict;
11
12my $count = 0;
13use warnings;
14
15print "1..4\n";
16
17# first check for stupid permissions second for full, so we clean up
18# behind ourselves
19for my $perm (0111,0777) {
20    my $path = catdir(curdir(), "mhx", "bar");
21    mkpath($path);
22    chmod $perm, "mhx", $path;
23
24    print "not " unless -d "mhx" && -d $path;
25    print "ok ", ++$count, "\n";
26
27    rmtree("mhx");
28    print "not " if -e "mhx";
29    print "ok ", ++$count, "\n";
30}
31