Better logging in tokenstream
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user