Skip to content

Commit

Permalink
correctly say multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Aug 27, 2015
1 parent 6fa9955 commit 6faf49f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions S32-io/pipe.t
Expand Up @@ -33,18 +33,18 @@ sub shell_captures_out_ok($code, $out, $exitcode, $desc) {
}

{
my $sh = shell("$*EXECUTABLE -e \"say reverse lines\"", :in, :out);
my $sh = shell("$*EXECUTABLE -e \".say for reverse lines\"", :in, :out);
$sh.in.say: "foo\nbar\nbaz";
$sh.in.close;
is $sh.out.slurp-rest, "baz bar foo\n", 'Can talk to subprocess bidirectional';
is $sh.out.slurp-rest, "baz\nbar\nfoo\n", 'Can talk to subprocess bidirectional';
}

{
my $sh1 = run($*EXECUTABLE, '-e', 'say join "\n", reverse lines', :in, :out);
$sh1.in.say: "foo\nbar\nbaz";
$sh1.in.close;
my $sh2 = run($*EXECUTABLE, '-e', 'my @l = lines; say @l; note @l.elems', :in($sh1.out), :out, :err);
is $sh2.out.slurp-rest, "baz bar foo\n", 'Can capture stdout and stderr, and chain stdin';
my $sh2 = run($*EXECUTABLE, '-e', 'my @l = lines; .say for @l; note @l.elems', :in($sh1.out), :out, :err);
is $sh2.out.slurp-rest, "baz\nbar\nfoo\n", 'Can capture stdout and stderr, and chain stdin';
is $sh2.err.slurp-rest, "3\n", 'Can capture stdout and stderr, and chain stdin';
}

Expand Down

0 comments on commit 6faf49f

Please sign in to comment.