Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make 'ok' always do a single I/O operation.
Means t/concurrency/01-thread.t output will not be garbled.
  • Loading branch information
jnthn committed May 4, 2015
1 parent a4d1d5f commit 3d9efcc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/core/testing.nqp
Expand Up @@ -9,17 +9,18 @@ sub plan($quantity) {
sub ok($condition, $desc?) {
$test_counter := $test_counter + 1;

my @output;
unless $condition {
print("not ");
@output.push("not ");
}
print("ok $test_counter");
@output.push("ok $test_counter");
if $desc {
print(" - $desc");
@output.push(" - $desc");
}
if $test_counter <= $todo_upto_test_num {
print($todo_reason);
@output.push($todo_reason);
}
print("\n");
say(|@output);

$condition ?? 1 !! 0
}
Expand Down

0 comments on commit 3d9efcc

Please sign in to comment.