Skip to content

Commit a28cfc3

Browse files
committed
Test nqp::eoffh
1 parent bb6add3 commit a28cfc3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/nqp/086-pipes.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Testing nqp::shell wrt capturing output.
44

5-
plan(11);
5+
plan(13);
66

77
my $read_out := nqp::const::PIPE_INHERIT_IN + nqp::const::PIPE_CAPTURE_OUT + nqp::const::PIPE_INHERIT_ERR;
88
my $read_out_and_err := nqp::const::PIPE_INHERIT_IN + nqp::const::PIPE_CAPTURE_OUT + nqp::const::PIPE_CAPTURE_ERR;
@@ -15,9 +15,13 @@ my $read_out_and_err := nqp::const::PIPE_INHERIT_IN + nqp::const::PIPE_CAPTURE_O
1515
nqp::setencoding($out, 'utf8');
1616
nqp::shell('echo aardvarks', nqp::cwd(), nqp::getenvhash(), $in, $out, $err, $read_out);
1717

18+
ok( !nqp::eoffh($out), 'nqp::eoffh on a pipe while it still has data' );
19+
1820
my $pstr := nqp::readallfh($out);
1921
ok( $pstr ~~ / 'aardvarks' /, 'nqp::readallfh with a pipe');
2022

23+
ok( nqp::eoffh($out), 'nqp::eoffh on a pipe we have read everything out of');
24+
2125
# What should the return value of nqp::close be? MoarVM and JVM always return 1.
2226
nqp::closefh($out); ok( 1, 'nqp::closefh with a pipe');
2327
nqp::closefh($out); ok( 1, 'nqp::closefh with a pipe already closed');

0 commit comments

Comments
 (0)