Split test
This commit is contained in:
@@ -75,6 +75,7 @@ static TestCase s_tests[] = {
|
|||||||
{"parser_module_name", test_parser_module_name},
|
{"parser_module_name", test_parser_module_name},
|
||||||
{"log_error", test_log_error},
|
{"log_error", test_log_error},
|
||||||
{"log_on_line", test_log_on_line},
|
{"log_on_line", test_log_on_line},
|
||||||
|
{"log_on_line_format", test_log_on_line_format},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -28,16 +28,16 @@ static void test_log_on_line(void) {
|
|||||||
" unexpected token\n";
|
" unexpected token\n";
|
||||||
|
|
||||||
log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token");
|
log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token");
|
||||||
|
|
||||||
assert_log(expected, "expected formatted error message");
|
assert_log(expected, "expected formatted error message");
|
||||||
|
}
|
||||||
|
|
||||||
log_clear();
|
static void test_log_on_line_format(void) {
|
||||||
const char* expected2 =
|
const char* expected =
|
||||||
"--- test.c ---\n"
|
"--- test.c ---\n"
|
||||||
"1| int main() []\n"
|
"1| int main() []\n"
|
||||||
" ^^\n"
|
" ^^\n"
|
||||||
" unexpected token 'x'\n";
|
" unexpected token 'x'\n";
|
||||||
|
|
||||||
log_on_line("test.c", "int main() []", 1, 12, 13, "unexpected token '%c'", 'x');
|
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");
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user