MCPcopy Create free account
hub / github.com/commonmark/cmark / test_content

Function test_content

api_test/main.c:507–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507static 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
526static void parser(test_batch_runner *runner) {
527 test_md_to_html(runner, "No newline", "<p>No newline</p>\n",

Callers 1

hierarchyFunction · 0.85

Calls 4

cmark_node_newFunction · 0.85
cmark_node_append_childFunction · 0.85
INT_EQFunction · 0.85
cmark_node_freeFunction · 0.85

Tested by

no test coverage detected