1N/A#!./perl
1N/A
1N/Aprint "1..13\n";
1N/A
1N/ABEGIN {
1N/A chdir 't' if -d 't';
1N/A @INC = '../lib';
1N/A}
1N/A
1N/Ause File::Path;
1N/Armtree('blurfl');
1N/A
1N/A# tests 3 and 7 rather naughtily expect English error messages
1N/A$ENV{'LC_ALL'} = 'C';
1N/A$ENV{LANGUAGE} = 'C'; # GNU locale extension
1N/A
1N/Aprint (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
1N/Aprint (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
1N/Aprint ($! =~ /cannot move|exist|denied/ ? "ok 3\n" : "# $!\nnot ok 3\n");
1N/Aprint (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
1N/Aprint (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
1N/Aprint (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
1N/Aprint ($! =~ /cannot find|such|exist|not found|not a directory/i ? "ok 7\n" : "# $!\nnot ok 7\n");
1N/Aprint (mkdir('blurfl') ? "ok 8\n" : "not ok 8\n");
1N/Aprint (rmdir('blurfl') ? "ok 9\n" : "not ok 9\n");
1N/A# trailing slashes will be removed before the system call to mkdir
1N/A# but we don't care for MacOS ...
1N/Aif ($^O eq 'MacOS') {
1N/A print "ok $_\n" for 10..13;
1N/A} else {
1N/A print (mkdir('blurfl///') ? "ok 10\n" : "not ok 10\n");
1N/A print (-d 'blurfl' ? "ok 11\n" : "not ok 11\n");
1N/A print (rmdir('blurfl///') ? "ok 12\n" : "not ok 12\n");
1N/A print (!-d 'blurfl' ? "ok 13\n" : "not ok 13\n");
1N/A}