Created
June 17, 2017 11:18
-
-
Save zoffixznet/440cf8f7131632aa673b75dbb3a625b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test; | |
my $sh1 = run($*EXECUTABLE, '-e', 'say join "\n", lines', :out, :in); | |
$sh1.in.write-internal: "foobarbaz".encode; | |
$sh1.in.close; | |
$sh1.out.close; | |
my $sh2 = run($*EXECUTABLE, '-e', 'my @l = lines; .say for @l;', :in($sh1.out), | |
:out ); | |
is $sh2.out.slurp(:close), "foobarbaz\n", 'Can capture stdout and stderr, and chain stdin'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment