From b35aa4ae1c771eae066a690f4a4311658188790f Mon Sep 17 00:00:00 2001 From: ochafik Date: Thu, 31 Oct 2024 13:53:33 +0000 Subject: [PATCH] `tool-call`: add LLAMA_UPDATE_GOLDENS env for test-chat-template --- tests/test-chat-template.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {