Fix double release calls in document spec

This commit is contained in:
Max Brunsfeld 2014-08-31 00:46:09 -07:00
parent 1cc64cd95a
commit a75686b017

View file

@ -122,7 +122,7 @@ describe("Document", [&]() {
});
describe("when the error occurs at the beginning of a token", [&]() {
it("computes the error node's size and position correctly", [&]() {
it("computes the error node's size and position correctly 1", [&]() {
ts_document_set_input_string(doc, " [123, @@@@@, true]");
AssertThat(ts_node_string(ts_document_root_node(doc)), Equals(
"(DOCUMENT (array (number) (ERROR '@') (true)))"));
@ -137,12 +137,11 @@ describe("Document", [&]() {
ts_node_release(error);
ts_node_release(array);
ts_node_release(error);
});
});
describe("when the error occurs in the middle of a token", [&]() {
it("computes the error node's size and position correctly", [&]() {
it("computes the error node's size and position correctly 2", [&]() {
ts_document_set_input_string(doc, " [123, total nonsense, true]");
AssertThat(ts_node_string(ts_document_root_node(doc)), Equals(
"(DOCUMENT (array (number) (ERROR 'o') (true)))"));
@ -157,12 +156,11 @@ describe("Document", [&]() {
ts_node_release(error);
ts_node_release(array);
ts_node_release(error);
});
});
describe("when the error occurs after one or more tokens", [&]() {
it("computes the error node's size and position correctly", [&]() {
it("computes the error node's size and position correctly 3", [&]() {
ts_document_set_input_string(doc, " [123, true false, true]");
AssertThat(ts_node_string(ts_document_root_node(doc)), Equals(
"(DOCUMENT (array (number) (ERROR 'f') (true)))"));
@ -177,7 +175,6 @@ describe("Document", [&]() {
ts_node_release(error);
ts_node_release(array);
ts_node_release(error);
});
});
});