-
-
Save zoffixznet/62f1f45c6afb32a83721a52b745466f4 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
subtest $desc => { | |
$path.IO.spurt: $code; | |
if shell :in, :out, :err, $script -> $_ { | |
plan 3; | |
# on MacOS, `script` really wants the ending newline... | |
.in.spurt: "$in\n", :close; | |
cmp-ok .out.slurp(:close), '~~', $out, 'STDOUT'; | |
cmp-ok .err.slurp(:close), '~~', $err, 'STDERR'; | |
cmp-ok .exitcode, '~~', $status, 'exit code'; | |
} | |
else { | |
plan 1; | |
flunk "Failed to run command; exitcode: $^proc.exitcode()"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment