diff --git a/test/parser/specific.c b/test/parser/specific.c index 001c61a..c4b6182 100644 --- a/test/parser/specific.c +++ b/test/parser/specific.c @@ -24,12 +24,18 @@ void test_parse_header() { const char *buf = "### hello world"; PARSER_OPEN(buf); - mrk_ast_node *root; - TEST_CHECK(mrk_parser_parse(&root, parser) == mrk_err_ok); + mrk_ast_node *header; + mrk_ast_node_init(&header); + TEST_CHECK(mrk_parser_parse_header(header, parser) == mrk_err_ok); - mrk_ast_node *header = root->children.arr[0]; TEST_CHECK(header->type == mrk_ast_node_type_header); - TEST_CHECK(header->children.arr[0]->type == mrk_ast_node_type_text); + TEST_CHECK(header->d.header.depth == 3); + TEST_CHECK(header->children.len == 1); + + mrk_ast_node *header_text = header->children.arr[0]; + TEST_CHECK(header_text->type == mrk_ast_node_type_text); + TEST_CHECK(header_text->d.text.start == 3); + TEST_CHECK(header_text->d.text.end == 15); } void test_parse_link() {