Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / op / glob.t
index c18ee2f..89263aa 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..11\n";
+print "1..9\n";
 
 @oops = @ops = <op/*>;
 
@@ -55,23 +55,19 @@ print $i == 2 ? "ok 7\n" : "not ok 7\n";
 
 # ... while ($var = glob(...)) should test definedness not truth
 
-# Create a file called "0"
-print open(F, ">0") ? "ok 8\n" : "not ok 8 # $!\n";
-close F;
-
-my $ok = "not ok 9\n";
-
-# ... while ($var = glob(...)) should test definedness not truth
-
-my $ok = "not ok 11\n";
-$ok = "ok 11\n" while my $var = glob("0");
-print $ok;
-$ok = "ok 9\n" while my $var = glob("0");
-print $ok;
-
-print unlink("0") ? "ok 10\n" : "not ok 10\n";
-
-END {
-    1 while unlink "0";
+if( $INC{'File/Glob.pm'} ) {
+    my $ok = "not ok 8\n";
+    $ok = "ok 8\n" while my $var = glob("0");
+    print $ok;
+}
+else {
+    print "ok 8 # skip: File::Glob emulated Unixism\n";
 }
 
+
+# The formerly-broken test for the situation above would accidentally
+# test definedness for an assignment with a LOGOP on the right:
+my $f=0;
+$ok="ok 9\n";
+$ok="not ok 9\n", undef $f while $x = $f||$f;
+print $ok