From 9ca72ef5bf8bbcc5aea5fb9cd0b3014b8b6265c9 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Fri, 24 Apr 2026 20:41:57 +0200 Subject: [PATCH] Split test --- v0/test.c | 1 + v0/test_log.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/v0/test.c b/v0/test.c index ef52077..e317795 100644 --- a/v0/test.c +++ b/v0/test.c @@ -75,6 +75,7 @@ static TestCase s_tests[] = { {"parser_module_name", test_parser_module_name}, {"log_error", test_log_error}, {"log_on_line", test_log_on_line}, + {"log_on_line_format", test_log_on_line_format}, }; diff --git a/v0/test_log.c b/v0/test_log.c index 18acc42..b690330 100644 --- a/v0/test_log.c +++ b/v0/test_log.c @@ -28,16 +28,16 @@ static void test_log_on_line(void) { " unexpected token\n"; log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token"); - assert_log(expected, "expected formatted error message"); +} - log_clear(); - const char* expected2 = +static void test_log_on_line_format(void) { + const char* expected = "--- test.c ---\n" "1| int main() []\n" " ^^\n" " unexpected token 'x'\n"; log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token '%c'", 'x'); - assert_log(expected2, "expected formatted error message with variadic args"); + assert_log(expected, "expected formatted error message with variadic args"); } \ No newline at end of file