From: Jesse Vincent Date: Sat, 10 Oct 2009 20:15:35 +0000 (-0400) Subject: Added a TODO test for RT#69332 - PerlIO returns undef instead of 0 on EOL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86cb0d3084b80528a1362f4a6b091000965f9beb;p=p5sagit%2Fp5-mst-13.2.git Added a TODO test for RT#69332 - PerlIO returns undef instead of 0 on EOL --- diff --git a/t/io/perlio.t b/t/io/perlio.t index c5f236d..cdc4c72 100644 --- a/t/io/perlio.t +++ b/t/io/perlio.t @@ -9,7 +9,7 @@ BEGIN { require './test.pl'; } -plan tests => 39; +plan tests => 40; use_ok('PerlIO'); @@ -145,6 +145,30 @@ SKIP: { } +{ local $TODO = 'fails well back into 5.8.x'; + + +sub read_fh_and_return_final_rv { + my ($fh) = @_; + my $buf = ''; + my $rv; + for (1..3) { + $rv = read($fh, $buf, 1, length($buf)); + next if $rv; + } + return $rv +} + +open(my $no_perlio, '<', \'ab') or die; +open(my $perlio, '<:crlf', \'ab') or die; + +is(read_fh_and_return_final_rv($perlio), read_fh_and_return_final_rv($no_perlio), "RT#69332 - perlio should return the same value as nonperlio after EOF"); + +close ($perlio); +close ($no_perlio); +} + + END { 1 while unlink $txt; 1 while unlink $bin;