Skip to content

Commit

Permalink
Merge pull request #623 from atroxaper/mkhorkov-1882
Browse files Browse the repository at this point in the history
Add test for run with :out(Handle:D) and :merge
  • Loading branch information
lizmat committed Feb 26, 2020
2 parents e75ef0a + 1af0b27 commit e7a0707
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S32-io/pipe.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use Test;
use lib $?FILE.IO.parent(2).add: 'packages/Test-Helpers';
use Test::Util;

plan 15;
plan 16;

proc_captures_out_ok '1', '', 0, 'Child succeeds but does not print anything';
proc_captures_out_ok '42.say', '42', 0, 'Child succeeds and prints something';
Expand Down Expand Up @@ -100,4 +100,13 @@ group-of 5 => 'bin pipes in Proc do not crash on open' => {
await $promise;
}

{
my $temp = make-temp-file;
my $out = $temp.IO.open :w;
my $proc = run $*EXECUTABLE, '-e', '$*ERR.say: "stderr out"; $*OUT.say: "stdout out"', :$out, :merge;
$out.close;
my $result = $temp.slurp;
is $result, "stderr out\nstdout out\n", 'merge with :out(Handle:D)';
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit e7a0707

Please sign in to comment.