parser panics on lvalue methods
[p5sagit/p5-mst-13.2.git] / t / op / glob.t
index cc60a17..8bdf64f 100755 (executable)
@@ -1,13 +1,26 @@
 #!./perl
 
-# $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
 
-print "1..6\n";
+print "1..10\n";
 
 @oops = @ops = <op/*>;
 
-map { $files{$_}++ } <op/*>;
-map { delete $files{$_} } split /[\s\n]/, `echo op/*`;
+if ($^O eq 'MSWin32') {
+  map { $files{lc($_)}++ } <op/*>;
+  map { delete $files{"op/$_"} } split /[\s\n]/, `dir /b /l op & dir /b /l /ah op 2>nul`,
+}
+elsif ($^O eq 'VMS') {
+  map { $files{lc($_)}++ } <[.op]*>;
+  map { s/;.*$//; delete $files{lc($_)}; } split /[\n]/, `directory/noheading/notrailing/versions=1 [.op]`,
+}
+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"; }
@@ -29,3 +42,21 @@ print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n";
 
 @glops = glob;
 print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n";
+
+# glob should still work even after the File::Glob stash has gone away
+# (this used to dump core)
+my $i = 0;
+for (1..2) {
+    eval "<.>";
+    undef %File::Glob::;
+    ++$i;
+}
+print $i == 2 ? "ok 7\n" : "not ok 7\n";
+
+# [ID 20010526.001] localized glob loses value when assigned to
+
+$j=1; %j=(a=>1); @j=(1); local *j=*j; *j = sub{};
+
+print $j    == 1 ? "ok 8\n"  : "not ok 8\n";
+print $j{a} == 1 ? "ok 9\n"  : "not ok 9\n";
+print $j[0] == 1 ? "ok 10\n" : "not ok 10\n";