From a75686b0179251aa37edc5da925df8d9caca49b7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 31 Aug 2014 00:46:09 -0700 Subject: [PATCH] Fix double release calls in document spec --- spec/runtime/document_spec.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec/runtime/document_spec.cc b/spec/runtime/document_spec.cc index 84578cba..bffc8e3b 100644 --- a/spec/runtime/document_spec.cc +++ b/spec/runtime/document_spec.cc @@ -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); }); }); });