Better logging in tokenstream

This commit is contained in:
2026-04-24 20:40:31 +02:00
parent 451a9a2a22
commit 0306530fe8
8 changed files with 58 additions and 17 deletions
+10
View File
@@ -30,4 +30,14 @@ static void test_log_on_line(void) {
log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token");
assert_log(expected, "expected formatted error message");
log_clear();
const char* expected2 =
"--- 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");
}