Refactor ts_tree_children

This commit is contained in:
Max Brunsfeld 2014-03-18 12:47:26 -07:00
parent 8e7f59db1c
commit fbb9b24d7b
4 changed files with 26 additions and 22 deletions

View file

@ -54,9 +54,9 @@ describe("json", []() {
ts_document_set_input_string(doc, " [12, 5]");
const ts_tree *tree = ts_document_tree(doc);
const ts_tree *array = ts_tree_children(tree)[0];
const ts_tree *number1 = ts_tree_children(array)[0];
const ts_tree *number2 = ts_tree_children(array)[1];
const ts_tree *array = ts_tree_children(tree, NULL)[0];
const ts_tree *number1 = ts_tree_children(array, NULL)[0];
const ts_tree *number2 = ts_tree_children(array, NULL)[1];
AssertThat(number1->offset, Equals<size_t>(0));
AssertThat(number1->size, Equals<size_t>(2));