From 33322e823e783a9b22e350dd89727f8aa6b82073 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sat, 18 Jan 2025 10:38:21 +0000 Subject: [PATCH] Flush stdout in chat template before potential crash --- tests/test-chat-template.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index d9e251240..190643136 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -291,6 +291,7 @@ int main(void) { printf("Expected:\n%s\n", test_case.expected_output.c_str()); printf("-------------------------\n"); printf("Actual:\n%s\n", output.c_str()); + fflush(stdout); assert(output == test_case.expected_output); } } @@ -315,6 +316,7 @@ int main(void) { printf("Expected:\n%s\n", expected_output.c_str()); printf("-------------------------\n"); printf("Actual:\n%s\n", output.c_str()); + fflush(stdout); assert(output == expected_output); } } catch (const std::exception & e) {