Skip to content

Commit 33322e8

Browse files
author
ochafik
committed
Flush stdout in chat template before potential crash
1 parent e63520f commit 33322e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test-chat-template.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ int main(void) {
291291
printf("Expected:\n%s\n", test_case.expected_output.c_str());
292292
printf("-------------------------\n");
293293
printf("Actual:\n%s\n", output.c_str());
294+
fflush(stdout);
294295
assert(output == test_case.expected_output);
295296
}
296297
}
@@ -315,6 +316,7 @@ int main(void) {
315316
printf("Expected:\n%s\n", expected_output.c_str());
316317
printf("-------------------------\n");
317318
printf("Actual:\n%s\n", output.c_str());
319+
fflush(stdout);
318320
assert(output == expected_output);
319321
}
320322
} catch (const std::exception & e) {

0 commit comments

Comments
 (0)