Skip to content

Commit

Permalink
[test] add test for GH #981, readall at eof
Browse files Browse the repository at this point in the history
fsils in master, fixed in smoke-me/readall_gentoo_gh981
  • Loading branch information
Reini Urban committed Sep 29, 2013
1 parent 58fe275 commit 9e47078
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion t/pmc/filehandle.t
Expand Up @@ -6,7 +6,7 @@ use warnings;
use lib qw( . lib ../lib ../../lib );

use Test::More;
use Parrot::Test tests => 33;
use Parrot::Test tests => 34;
use Parrot::Test::Util 'create_tempfile';

=head1 NAME
Expand Down Expand Up @@ -735,6 +735,38 @@ CODE
ok
OUTPUT


pir_output_is( <<"CODE", <<"OUTPUT", "readall() - at eof GH #981" );
.sub main :main
\$S0 = <<"EOS"
line 1
line 2
line 3
EOS
.local pmc pio, pio2
pio = new ['FileHandle']
pio.'open'("$temp_file", "w")
pio.'print'(\$S0)
pio.'close'()
pio2 = new ['FileHandle']
pio2.'open'("$temp_file", "r")
\$S1 = pio2.'readall'()
if \$S0 == \$S1 goto ok
print "not "
ok:
say "ok"
\$S1 = pio2.'readall'()
if \$S1 == '' goto ok2
print "not "
ok2:
say "ok"
.end
CODE
ok
ok
OUTPUT

pir_output_is( <<'CODE', <<'OUTPUT', "readall - failure conditions" );
.include 'except_types.pasm'
.sub main :main
Expand Down

0 comments on commit 9e47078

Please sign in to comment.