diff --git a/tests/test-chat-template.cpp b/tests/test-chat-template.cpp index 868dd8cf8..554a8036d 100644 --- a/tests/test-chat-template.cpp +++ b/tests/test-chat-template.cpp @@ -117,7 +117,11 @@ static void test_jinja_templates() { } catch (const std::runtime_error & e) { actual = "ERROR: " + std::string(e.what()); } - assert_equals(expected, actual); + if (getenv("LLAMA_UPDATE_GOLDENS")) { + std::ofstream(golden_file) << actual; + } else { + assert_equals(expected, actual); + } } if (!found_goldens) {