Skip to content

Commit

Permalink
Test failed Proc sinking and pipe handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Jun 13, 2017
1 parent 31e2f17 commit 56c5a98
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion S29-os/system.t
Expand Up @@ -8,7 +8,7 @@ use Test::Util;
# L<S29/"OS"/"=item run">
# system is renamed to run, so link there.

plan 36;
plan 37;

my $res;

Expand Down Expand Up @@ -130,4 +130,17 @@ isnt run("dir", "t"), BEGIN { run("dir", "t") }, 'run() is affected by chdir()';
is-deeply $res, 'Testing42', 'run sets $cwd and $env';
}

subtest '.out/.err proc pipes on failed command' => {
plan 4;

throws-like { run(:out, "meooooooows").out.close }, X::Proc::Unsuccessful,
'.out.close Proc explodes when sunk';
throws-like { run(:err, "meooooooows").err.close }, X::Proc::Unsuccessful,
'.err.close Proc explodes when sunk';
is-deeply run(:out, "meooooooows").out.slurp(:close), '',
'.out.slurp is empty';
is-deeply run(:err, "meooooooows").err.slurp(:close), '',
'.err.slurp is empty';
}

# vim: ft=perl6

0 comments on commit 56c5a98

Please sign in to comment.