summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2014-11-26 16:25:07 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2014-11-26 16:25:07 +0100
commit30c389623cb6e4e79adcb97c7f743830fcc843c0 (patch)
tree25f3fdde93802f8dceceb06b7c3efbf70757cac3 /api_test
parentf7613e98edbb8987e0e0ecfb3c789c7ee8d60017 (diff)
Don't allow insert_{before|after} root node
This can be changed if support for node lists is added to the public API.
Diffstat (limited to 'api_test')
-rw-r--r--api_test/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/api_test/main.c b/api_test/main.c
index 8e6acea..709b8d3 100644
--- a/api_test/main.c
+++ b/api_test/main.c
@@ -298,6 +298,10 @@ create_tree(test_batch_runner *runner)
cmark_node *doc = cmark_node_new(CMARK_NODE_DOCUMENT);
cmark_node *p = cmark_node_new(CMARK_NODE_PARAGRAPH);
+ OK(runner, !cmark_node_insert_before(doc, p),
+ "insert before root fails");
+ OK(runner, !cmark_node_insert_after(doc, p),
+ "insert after root fails");
OK(runner, cmark_node_append_child(doc, p), "append1");
INT_EQ(runner, cmark_node_check(doc, NULL), 0, "append1 consistent");
OK(runner, cmark_node_parent(p) == doc, "node_parent");