Skip to content

Commit 3d9efcc

Browse files
committed
Make 'ok' always do a single I/O operation.
Means t/concurrency/01-thread.t output will not be garbled.
1 parent a4d1d5f commit 3d9efcc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/testing.nqp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ sub plan($quantity) {
99
sub ok($condition, $desc?) {
1010
$test_counter := $test_counter + 1;
1111

12+
my @output;
1213
unless $condition {
13-
print("not ");
14+
@output.push("not ");
1415
}
15-
print("ok $test_counter");
16+
@output.push("ok $test_counter");
1617
if $desc {
17-
print(" - $desc");
18+
@output.push(" - $desc");
1819
}
1920
if $test_counter <= $todo_upto_test_num {
20-
print($todo_reason);
21+
@output.push($todo_reason);
2122
}
22-
print("\n");
23+
say(|@output);
2324

2425
$condition ?? 1 !! 0
2526
}

0 commit comments

Comments
 (0)