Commit | Line | Data |
---|---|---|
491873e5 | 1 | #!./perl -w |
a687059c | 2 | |
5a211162 | 3 | BEGIN { |
4 | chdir 't' if -d 't'; | |
20822f61 | 5 | @INC = '../lib'; |
1d4be626 | 6 | require './test.pl'; |
1f47e8e2 | 7 | } |
a687059c | 8 | |
491873e5 | 9 | plan tests => 22; |
1d4be626 | 10 | |
5a211162 | 11 | use File::Path; |
12 | rmtree('blurfl'); | |
13 | ||
3458556d | 14 | # tests 3 and 7 rather naughtily expect English error messages |
15 | $ENV{'LC_ALL'} = 'C'; | |
b598356e | 16 | $ENV{LANGUAGE} = 'C'; # GNU locale extension |
3458556d | 17 | |
1d4be626 | 18 | ok(mkdir('blurfl',0777)); |
19 | ok(!mkdir('blurfl',0777)); | |
d13bc652 | 20 | like($!, qr/cannot move|exist|denied|unknown/i); |
1d4be626 | 21 | ok(-d 'blurfl'); |
22 | ok(rmdir('blurfl')); | |
23 | ok(!rmdir('blurfl')); | |
d13bc652 | 24 | like($!, qr/cannot find|such|exist|not found|not a directory|unknown/i); |
1d4be626 | 25 | ok(mkdir('blurfl')); |
26 | ok(rmdir('blurfl')); | |
27 | ||
7b903762 | 28 | # trailing slashes will be removed before the system call to mkdir |
29 | ok(mkdir('blurfl///')); | |
30 | ok(-d 'blurfl'); | |
31 | ok(rmdir('blurfl///')); | |
32 | ok(!-d 'blurfl'); | |
491873e5 | 33 | |
34 | # test default argument | |
35 | ||
36 | $_ = 'blurfl'; | |
37 | ok(mkdir); | |
38 | ok(-d); | |
39 | ok(rmdir); | |
40 | ok(!-d); | |
41 | $_ = 'lfrulb'; | |
42 | ||
43 | { | |
44 | my $_ = 'blurfl'; | |
45 | ok(mkdir); | |
46 | ok(-d); | |
47 | ok(-d 'blurfl'); | |
48 | ok(!-d 'lfrulb'); | |
49 | ok(rmdir); | |
50 | } |