Skip to content

Commit

Permalink
differentiate the expected stdout output from that of stderr
Browse files Browse the repository at this point in the history
+ helps ensure we're testing the correct stream

other changes

 + use consistent four-space indents
  • Loading branch information
tbrowder committed Feb 15, 2018
1 parent 6dd8011 commit dfb8914
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions t/nqp/111-spawnprocasync.t
Expand Up @@ -54,7 +54,7 @@ my $config := nqp::hash(
);

# define a task
$string := "expected output";
$string := "expected output from stdout";
$command := "echo $string";
$args := $is-windows ?? nqp::list(nqp::getenvhash()<ComSpec>, '/c', $command)
!! nqp::list('/bin/sh', '-c', $command);
Expand All @@ -65,11 +65,11 @@ nqp::permit($task, 1, -1);
while !$done || !$read_all {
if nqp::shift($queue) -> $task {
if nqp::list($task) {
my $code := nqp::shift($task);
$code(|$task);
my $code := nqp::shift($task);
$code(|$task);
}
else {
$task();
$task();
}
}
}
Expand All @@ -89,7 +89,7 @@ $read_all := 0;
$called_ready := 0;

# define the task
$string := "expected output";
$string := "expected output from stderr";
$command := "echo $string >&2";
$args := $is-windows ?? nqp::list(nqp::getenvhash()<ComSpec>, '/c', $command)
!! nqp::list('/bin/sh', '-c', $command);
Expand All @@ -100,11 +100,11 @@ nqp::permit($task, 2, -1);
while !$done || !$read_all {
if nqp::shift($queue) -> $task {
if nqp::list($task) {
my $code := nqp::shift($task);
$code(|$task);
my $code := nqp::shift($task);
$code(|$task);
}
else {
$task();
$task();
}
}
}
Expand Down

0 comments on commit dfb8914

Please sign in to comment.