Make C<undef ~~ 0> and C<undef ~~ ""> not match (like in 5.10.0)
[p5sagit/p5-mst-13.2.git] / t / op / read.t
old mode 100755 (executable)
new mode 100644 (file)
index 4aaaeab..23f1b51
@@ -1,7 +1,5 @@
 #!./perl
 
-# $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $
-
 BEGIN {
     chdir 't';
     @INC = '../lib';
@@ -33,9 +31,7 @@ my $has_perlio = !eval {
     !$Config::Config{useperlio}
 };
 
-my $tmpfile = 'Op_read.tmp';
-
-1 while unlink $tmpfile;
+my $tmpfile = tempfile();
 
 my (@values, @buffers) = ('', '');
 
@@ -58,7 +54,6 @@ foreach my $value (@values) {
            skip "Needs :utf8 layer but no perlio", 2 * @offsets * @lengths
              if $utf8 and !$has_perlio;
 
-           1 while unlink $tmpfile;
            open FH, ">$tmpfile" or die "Can't open $tmpfile: $!";
            binmode FH, "utf8" if $utf8;
            print FH $value;
@@ -90,6 +85,7 @@ foreach my $value (@values) {
                    $got = read (FH, $buffer, $length, $offset);
                    is ($got, length $will_read, "got $what");
                    is ($buffer, $expect, "buffer $what");
+                   close FH;
                }
            }
        }