Cannot portably compare files if one of them is still open
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 2 Apr 2003 04:42:40 +0000 (04:42 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 2 Apr 2003 04:42:40 +0000 (04:42 +0000)
(from Craig Berry).

p4raw-id: //depot/perl@19130

ext/Encode/t/enc_module.t

index ac9bf3c..0910029 100644 (file)
@@ -38,6 +38,7 @@ open STDOUT, ">", $file1 or die "$file1:$!";
 print $obj->str, "\n";
 $obj->set("¥Æ¥¹¥Èʸ»úÎó");
 print $obj->str, "\n";
+close STDOUT;
 
 my $cmp = compare_text($file0, $file1);
 is($cmp, 0, "encoding vs. STDOUT");
@@ -51,7 +52,6 @@ while(<STDIN>){
     is ($cmp[$i++], $_, "encoding vs. STDIN - $i");
 }
 
-close STDOUT;
 unlink $file1 unless $cmp;
 __END__