home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / t / op / mkdir.t < prev    next >
Text File  |  2000-02-20  |  777b  |  26 lines

  1. #!./perl
  2.  
  3. print "1..9\n";
  4.  
  5. BEGIN {
  6.     chdir 't' if -d 't';
  7.     unshift @INC, '../lib';
  8. }
  9.  
  10. use File::Path;
  11. rmtree('blurfl');
  12.  
  13. # tests 3 and 7 rather naughtily expect English error messages
  14. $ENV{'LC_ALL'} = 'C';
  15. $ENV{LANGUAGE} = 'C'; # GNU locale extension
  16.  
  17. print (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
  18. print (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
  19. print ($! =~ /cannot move|exist|denied/ ? "ok 3\n" : "# $!\nnot ok 3\n");
  20. print (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
  21. print (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
  22. print (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
  23. print ($! =~ /cannot find|such|exist|not found/i ? "ok 7\n" : "# $!\nnot ok 7\n");
  24. print (mkdir('blurfl') ? "ok 8\n" : "not ok 8\n");
  25. print (rmdir('blurfl') ? "ok 9\n" : "not ok 9\n");
  26.