SYN SYN
[p5sagit/p5-mst-13.2.git] / t / op / glob.t
index b403844..fc0ba77 100755 (executable)
@@ -1,15 +1,25 @@
 #!./perl
 
-# $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $
-
-print "1..4\n";
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
 
-@ops = <op/*>;
-$list = join(' ',@ops);
+print "1..6\n";
 
-chop($otherway = `echo op/*`);
+@oops = @ops = <op/*>;
 
-print $list eq $otherway ? "ok 1\n" : "not ok 1\n$list\n$otherway\n";
+if ($^O eq 'MSWin32') {
+  map { $files{lc($_)}++ } <op/*>;
+  map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op & dir /b /l /ah op 2>nul"`,
+}
+else {
+  map { $files{$_}++ } <op/*>;
+  map { delete $files{$_} } split /[\s\n]/, `echo op/*`;
+}
+if (keys %files) {
+       print "not ok 1\t(",join(' ', sort keys %files),"\n";
+} else { print "ok 1\n"; }
 
 print $/ eq "\n" ? "ok 2\n" : "not ok 2\n";
 
@@ -20,3 +30,11 @@ while (<jskdfjskdfj* op/* jskdjfjkosvk*>) {
 print "${not}ok 3\n";
 
 print $/ eq "\n" ? "ok 4\n" : "not ok 4\n";
+
+# test the "glob" operator
+$_ = "op/*";
+@glops = glob $_;
+print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n";
+
+@glops = glob;
+print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n";