ea55dedd07
- Split ast.h into granular headers in v0/ast/ - Split parser.c into modular implementation files in v0/parser/ - Move and rename parser tests to v0/parser/test_*.c - Update build system (include.mk) with modular sub-makefiles - Maintain v0/ast.h and v0/parser.h as umbrella headers
22 lines
550 B
C
22 lines
550 B
C
#include "../test.h"
|
|
#include "../parser.h"
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
static void test_parser_module_name(void) {
|
|
Module* m = test_get_ast();
|
|
|
|
assert_not_null(m, "expected module to be parsed");
|
|
assert_str("my_module", m->name, "expected name 'my_module'");
|
|
}
|
|
|
|
static void test_parser_bad_module_name(void) {
|
|
test_get_ast();
|
|
assert_log_file("expected error to be logged for bad module name");
|
|
}
|
|
|
|
static void test_parser_missing_semicolon_module(void) {
|
|
test_get_ast();
|
|
assert_log_file("expected error for missing semicolon");
|
|
}
|