| 505 | } |
| 506 | |
| 507 | static void test_content(test_batch_runner *runner, cmark_node_type type, |
| 508 | int allowed_content) { |
| 509 | cmark_node *node = cmark_node_new(type); |
| 510 | |
| 511 | for (int i = 0; i < num_node_types; ++i) { |
| 512 | cmark_node_type child_type = node_types[i]; |
| 513 | cmark_node *child = cmark_node_new(child_type); |
| 514 | |
| 515 | int got = cmark_node_append_child(node, child); |
| 516 | int expected = (allowed_content >> child_type) & 1; |
| 517 | |
| 518 | INT_EQ(runner, got, expected, "add %d as child of %d", child_type, type); |
| 519 | |
| 520 | cmark_node_free(child); |
| 521 | } |
| 522 | |
| 523 | cmark_node_free(node); |
| 524 | } |
| 525 | |
| 526 | static void parser(test_batch_runner *runner) { |
| 527 | test_md_to_html(runner, "No newline", "<p>No newline</p>\n", |
no test coverage detected