diff --git a/src/runtime/parser.c b/src/runtime/parser.c index 37487401..8af62ea3 100644 --- a/src/runtime/parser.c +++ b/src/runtime/parser.c @@ -398,8 +398,6 @@ static Subtree ts_parser__lex(TSParser *self, StackVersion version, TSStateId pa last_byte_scanned = self->lexer.current_position.bytes; } - uint32_t bytes_scanned = last_byte_scanned - start_position.bytes + 1; - Subtree result; if (skipped_error) { Length padding = length_sub(error_start_position, start_position); @@ -409,7 +407,7 @@ static Subtree ts_parser__lex(TSParser *self, StackVersion version, TSStateId pa first_error_character, padding, size, - bytes_scanned, + last_byte_scanned + 1 - error_end_position.bytes, parse_state, self->language ); @@ -444,7 +442,7 @@ static Subtree ts_parser__lex(TSParser *self, StackVersion version, TSStateId pa symbol, padding, size, - bytes_scanned, + last_byte_scanned + 1 - self->lexer.token_end_position.bytes, parse_state, found_external_token, is_keyword, diff --git a/src/runtime/subtree.c b/src/runtime/subtree.c index 3f3f2a83..3094c581 100644 --- a/src/runtime/subtree.c +++ b/src/runtime/subtree.c @@ -158,29 +158,28 @@ static void ts_subtree_pool_free(SubtreePool *self, SubtreeHeapData *tree) { // Subtree -static inline bool ts_subtree_can_inline(Length padding, Length size) { +static inline bool ts_subtree_can_inline(Length padding, Length size, uint32_t lookahead_bytes) { return padding.bytes < TS_MAX_INLINE_TREE_LENGTH && padding.extent.row < 16 && padding.extent.column < TS_MAX_INLINE_TREE_LENGTH && size.extent.row == 0 && - size.extent.column < TS_MAX_INLINE_TREE_LENGTH; + size.extent.column < TS_MAX_INLINE_TREE_LENGTH && + lookahead_bytes < 16; } Subtree ts_subtree_new_leaf( SubtreePool *pool, TSSymbol symbol, Length padding, Length size, - uint32_t bytes_scanned, TSStateId parse_state, bool has_external_tokens, + uint32_t lookahead_bytes, TSStateId parse_state, bool has_external_tokens, bool is_keyword, const TSLanguage *language ) { TSSymbolMetadata metadata = ts_language_symbol_metadata(language, symbol); - unsigned additional_bytes_scanned = bytes_scanned - size.bytes - padding.bytes; bool extra = symbol == ts_builtin_sym_end; bool is_inline = ( symbol <= UINT8_MAX && - additional_bytes_scanned < 16 && !has_external_tokens && - ts_subtree_can_inline(padding, size) + ts_subtree_can_inline(padding, size, lookahead_bytes) ); if (is_inline) { @@ -191,7 +190,7 @@ Subtree ts_subtree_new_leaf( .padding_rows = padding.extent.row, .padding_columns = padding.extent.column, .size_bytes = size.bytes, - .additional_bytes_scanned = additional_bytes_scanned, + .lookahead_bytes = lookahead_bytes, .visible = metadata.visible, .named = metadata.named, .extra = extra, @@ -206,7 +205,7 @@ Subtree ts_subtree_new_leaf( .ref_count = 1, .padding = padding, .size = size, - .bytes_scanned = bytes_scanned, + .lookahead_bytes = lookahead_bytes, .error_cost = 0, .child_count = 0, .symbol = symbol, @@ -359,6 +358,7 @@ void ts_subtree_set_children( uint32_t non_extra_index = 0; const TSSymbol *alias_sequence = ts_language_alias_sequence(language, self.ptr->alias_sequence_id); + uint32_t lookahead_end_byte = 0; for (uint32_t i = 0; i < self.ptr->child_count; i++) { Subtree child = self.ptr->children[i]; @@ -366,13 +366,16 @@ void ts_subtree_set_children( if (i == 0) { self.ptr->padding = ts_subtree_padding(child); self.ptr->size = ts_subtree_size(child); - self.ptr->bytes_scanned = ts_subtree_bytes_scanned(child); } else { - uint32_t bytes_scanned = self.ptr->padding.bytes + self.ptr->size.bytes + ts_subtree_bytes_scanned(child); - if (bytes_scanned > self.ptr->bytes_scanned) self.ptr->bytes_scanned = bytes_scanned; self.ptr->size = length_add(self.ptr->size, ts_subtree_total_size(child)); } + uint32_t child_lookahead_end_byte = + self.ptr->padding.bytes + + self.ptr->size.bytes + + ts_subtree_lookahead_bytes(child); + if (child_lookahead_end_byte > lookahead_end_byte) lookahead_end_byte = child_lookahead_end_byte; + if (ts_subtree_symbol(child) != ts_builtin_sym_error_repeat) { self.ptr->error_cost += ts_subtree_error_cost(child); } @@ -403,6 +406,8 @@ void ts_subtree_set_children( if (!ts_subtree_extra(child)) non_extra_index++; } + self.ptr->lookahead_bytes = lookahead_end_byte - self.ptr->size.bytes - self.ptr->padding.bytes; + if (self.ptr->symbol == ts_builtin_sym_error || self.ptr->symbol == ts_builtin_sym_error_repeat) { self.ptr->error_cost += ERROR_COST_PER_RECOVERY + @@ -607,11 +612,11 @@ Subtree ts_subtree_edit(Subtree self, const TSInputEdit *edit, SubtreePool *pool Edit edit = entry.edit; bool is_noop = edit.old_end.bytes == edit.start.bytes && edit.new_end.bytes == edit.start.bytes; bool is_pure_insertion = edit.old_end.bytes == edit.start.bytes; - uint32_t bytes_scanned = ts_subtree_bytes_scanned(*entry.tree); - if (is_noop && edit.start.bytes >= bytes_scanned) continue; Length size = ts_subtree_size(*entry.tree); Length padding = ts_subtree_padding(*entry.tree); + uint32_t lookahead_bytes = ts_subtree_lookahead_bytes(*entry.tree); + if (is_noop && edit.start.bytes >= padding.bytes + size.bytes + lookahead_bytes) continue; // If the edit is entirely within the space before this subtree, then shift this // subtree over according to the edit without changing its size. @@ -647,7 +652,7 @@ Subtree ts_subtree_edit(Subtree self, const TSInputEdit *edit, SubtreePool *pool MutableSubtree result = ts_subtree_make_mut(pool, *entry.tree); if (result.data.is_inline) { - if (ts_subtree_can_inline(padding, size)) { + if (ts_subtree_can_inline(padding, size, lookahead_bytes)) { result.data.padding_bytes = padding.bytes; result.data.padding_rows = padding.extent.row; result.data.padding_columns = padding.extent.column; @@ -657,7 +662,7 @@ Subtree ts_subtree_edit(Subtree self, const TSInputEdit *edit, SubtreePool *pool data->ref_count = 1; data->padding = padding; data->size = size; - data->bytes_scanned = bytes_scanned; + data->lookahead_bytes = lookahead_bytes; data->error_cost = 0; data->child_count = 0; data->symbol = result.data.symbol; @@ -859,13 +864,13 @@ void ts_subtree__print_dot_graph(const Subtree *self, uint32_t start_offset, "error-cost: %u\n" "has-changes: %u\n" "repeat-depth: %u\n" - "bytes-scanned: %u\"]\n", + "lookahead-bytes: %u\"]\n", start_offset, end_offset, ts_subtree_parse_state(*self), ts_subtree_error_cost(*self), ts_subtree_has_changes(*self), ts_subtree_repeat_depth(*self), - ts_subtree_bytes_scanned(*self) + ts_subtree_lookahead_bytes(*self) ); uint32_t child_start_offset = start_offset; diff --git a/src/runtime/subtree.h b/src/runtime/subtree.h index 349ab85e..de3ddc16 100644 --- a/src/runtime/subtree.h +++ b/src/runtime/subtree.h @@ -40,7 +40,7 @@ typedef struct { uint8_t size_bytes; uint8_t padding_columns; uint8_t padding_rows : 4; - uint8_t additional_bytes_scanned : 4; + uint8_t lookahead_bytes : 4; uint16_t parse_state; } SubtreeInlineData; @@ -48,7 +48,7 @@ typedef struct { volatile uint32_t ref_count; Length padding; Length size; - uint32_t bytes_scanned; + uint32_t lookahead_bytes; uint32_t error_cost; uint32_t child_count; TSSymbol symbol; @@ -150,6 +150,7 @@ static inline bool ts_subtree_has_changes(Subtree self) { return SUBTREE_GET(sel static inline bool ts_subtree_missing(Subtree self) { return SUBTREE_GET(self, is_missing); } static inline bool ts_subtree_is_keyword(Subtree self) { return SUBTREE_GET(self, is_keyword); } static inline TSStateId ts_subtree_parse_state(Subtree self) { return SUBTREE_GET(self, parse_state); } +static inline uint32_t ts_subtree_lookahead_bytes(Subtree self) { return SUBTREE_GET(self, lookahead_bytes); } #undef SUBTREE_GET @@ -208,14 +209,6 @@ static inline uint32_t ts_subtree_total_bytes(Subtree self) { return ts_subtree_total_size(self).bytes; } -static inline uint32_t ts_subtree_bytes_scanned(Subtree self) { - return self.data.is_inline - ? (uint32_t)self.data.padding_bytes + - (uint32_t)self.data.size_bytes + - (uint32_t)self.data.additional_bytes_scanned - : self.ptr->bytes_scanned; -} - static inline uint32_t ts_subtree_child_count(Subtree self) { return self.data.is_inline ? 0 : self.ptr->child_count; } diff --git a/test/helpers/random_helpers.cc b/test/helpers/random_helpers.cc index b0200e51..480e18d2 100644 --- a/test/helpers/random_helpers.cc +++ b/test/helpers/random_helpers.cc @@ -7,8 +7,6 @@ using std::string; using std::vector; -Generator default_generator(0); - unsigned get_time_as_seed() { return time(nullptr); } diff --git a/test/helpers/random_helpers.h b/test/helpers/random_helpers.h index 7dd471fd..f5813d29 100644 --- a/test/helpers/random_helpers.h +++ b/test/helpers/random_helpers.h @@ -23,6 +23,4 @@ public: void sleep_some(); }; -extern Generator default_generator; - #endif // HELPERS_RANDOM_HELPERS_H_ diff --git a/test/helpers/spy_input.cc b/test/helpers/spy_input.cc index 8aa8963b..86fc80c5 100644 --- a/test/helpers/spy_input.cc +++ b/test/helpers/spy_input.cc @@ -103,6 +103,10 @@ TSInputEdit SpyInput::replace(size_t start_byte, size_t bytes_removed, string te return result; } +bool SpyInput::can_undo() const { + return !undo_stack.empty(); +} + TSInputEdit SpyInput::undo() { SpyInputEdit entry = undo_stack.back(); undo_stack.pop_back(); diff --git a/test/helpers/spy_input.h b/test/helpers/spy_input.h index 31cd1d8f..a1f67c18 100644 --- a/test/helpers/spy_input.h +++ b/test/helpers/spy_input.h @@ -25,6 +25,7 @@ class SpyInput { TSInput input(); void clear(); TSInputEdit replace(size_t start_char, size_t chars_removed, std::string text); + bool can_undo() const; TSInputEdit undo(); std::vector strings_read() const; diff --git a/test/helpers/tree_helpers.cc b/test/helpers/tree_helpers.cc index 768e9f61..cf4341bc 100644 --- a/test/helpers/tree_helpers.cc +++ b/test/helpers/tree_helpers.cc @@ -120,3 +120,10 @@ void assert_consistent_tree_sizes(const TSTree *tree, const string &text) { AssertThat(ts_node_end_byte(root_node), Equals(text.size())); assert_consistent_tree_sizes(root_node, line_starts); } + +string to_string(const TSTree *tree) { + const char *c_string = ts_node_string(ts_tree_root_node(tree)); + string result(c_string); + ts_free((void *)c_string); + return result; +} diff --git a/test/helpers/tree_helpers.h b/test/helpers/tree_helpers.h index 2b59cea8..21b1d7f2 100644 --- a/test/helpers/tree_helpers.h +++ b/test/helpers/tree_helpers.h @@ -12,6 +12,7 @@ std::ostream &operator<<(std::ostream &stream, Subtree tree); std::ostream &operator<<(std::ostream &stream, const TSNode &node); bool operator==(const TSNode &left, const TSNode &right); bool operator==(const std::vector &right, const SubtreeArray &array); +std::string to_string(const TSTree *); void assert_consistent_tree_sizes(const TSTree *, const std::string &); diff --git a/test/integration/real_grammars.cc b/test/integration/real_grammars.cc index 6cacffde..6c951168 100644 --- a/test/integration/real_grammars.cc +++ b/test/integration/real_grammars.cc @@ -11,7 +11,7 @@ #include "helpers/tree_helpers.h" #include -START_TEST +START_TEST; if (TREE_SITTER_SEED == -1) return; @@ -26,9 +26,10 @@ vector test_languages({ }); for (auto &language_name : test_languages) { - describe(("the " + language_name + " language").c_str(), [&]() { + describe("the " + language_name + " language", [&]() { TSParser *parser; const bool debug_graphs_enabled = getenv("TREE_SITTER_ENABLE_DEBUG_GRAPHS"); + Generator random(0); before_each([&]() { record_alloc::start(); @@ -47,14 +48,12 @@ for (auto &language_name : test_languages) { }); for (auto &entry : read_real_language_corpus(language_name)) { - SpyInput *input; + it("parses " + entry.description + ": initial parse", [&]() { + SpyInput input(entry.input, 4); + if (debug_graphs_enabled) printf("%s\n\n", input.content.c_str()); - it(("parses " + entry.description + ": initial parse").c_str(), [&]() { - input = new SpyInput(entry.input, 4); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); - - TSTree *tree = ts_parser_parse(parser, nullptr, input->input()); - assert_consistent_tree_sizes(tree, input->content); + TSTree *tree = ts_parser_parse(parser, nullptr, input.input()); + assert_consistent_tree_sizes(tree, input.content); TSNode root_node = ts_tree_root_node(tree); const char *node_string = ts_node_string(root_node); @@ -63,105 +62,93 @@ for (auto &language_name : test_languages) { AssertThat(result, Equals(entry.tree_string)); ts_tree_delete(tree); - delete input; }); - set> deletions; - set> insertions; + for (unsigned i = 0; i < 20; i++) { + unsigned int seed = TREE_SITTER_SEED + i; - for (size_t i = 0; i < 60; i++) { - size_t edit_position = default_generator(entry.input.size()); - size_t deletion_size = default_generator(entry.input.size() - edit_position); - string inserted_text = default_generator.words(default_generator(4) + 1); + it("parses " + entry.description + ": " + "edit sequence " + to_string(seed), [&]() { + random.reseed(seed); + SpyInput input(entry.input, 3); + unsigned edit_count = 1 + random(4); - if (insertions.insert({edit_position, inserted_text}).second) { - it(("parses " + entry.description + - ": repairing an insertion of \"" + inserted_text + "\"" + - " at " + to_string(edit_position)).c_str(), [&]() { - input = new SpyInput(entry.input, 3); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); + // Parse the input from the corpus. + if (debug_graphs_enabled) printf("\n%s\n", input.content.c_str()); + TSTree *tree = ts_parser_parse(parser, nullptr, input.input()); - input->replace(edit_position, 0, inserted_text); - TSTree *tree = ts_parser_parse(parser, nullptr, input->input()); - assert_consistent_tree_sizes(tree, input->content); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); - - TSInputEdit edit = input->undo(); + // Perform a random series of edits. + for (unsigned j = 0; j < edit_count; j++) { + size_t edit_position = random(input.content.size()); + size_t deletion_size = random(input.content.size() - edit_position); + string inserted_text = random.words(1 + random(4)); + TSInputEdit edit = input.replace(edit_position, deletion_size, inserted_text); ts_tree_edit(tree, &edit); - assert_consistent_tree_sizes(tree, input->content); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); + if (debug_graphs_enabled) { + ts_tree_print_dot_graph(tree, stderr); + printf( + "edit: %u - %u, %u - %u\n%s\n", + edit.start_byte, edit.old_end_byte, + edit.start_byte, edit.new_end_byte, + input.content.c_str() + ); + } + } - TSTree *new_tree = ts_parser_parse(parser, tree, input->input()); - assert_consistent_tree_sizes(new_tree, input->content); + // Reparse the edited code incrementally. + TSTree *new_tree = ts_parser_parse(parser, tree, input.input()); + assert_consistent_tree_sizes(new_tree, input.content); - uint32_t range_count; - TSRange *ranges = ts_tree_get_changed_ranges(tree, new_tree, &range_count); + // Verify that the correct ranges have been marked as changed. + uint32_t range_count; + TSRange *ranges = ts_tree_get_changed_ranges(tree, new_tree, &range_count); + ScopeSequence old_scope_sequence = build_scope_sequence(tree, input.content); + ScopeSequence new_scope_sequence = build_scope_sequence(new_tree, input.content); + verify_changed_ranges( + old_scope_sequence, new_scope_sequence, + input.content, ranges, range_count + ); + ts_free(ranges); + ts_tree_delete(tree); + tree = new_tree; - ScopeSequence old_scope_sequence = build_scope_sequence(tree, input->content); - ScopeSequence new_scope_sequence = build_scope_sequence(new_tree, input->content); - verify_changed_ranges( - old_scope_sequence, new_scope_sequence, - input->content, ranges, range_count - ); - ts_free(ranges); + // Undo the random edits. + while (input.can_undo()) { + TSInputEdit edit = input.undo(); + ts_tree_edit(new_tree, &edit); + if (debug_graphs_enabled) { + ts_tree_print_dot_graph(tree, stderr); + printf( + "edit: %u - %u, %u - %u\n%s\n", + edit.start_byte, edit.old_end_byte, + edit.start_byte, edit.new_end_byte, + input.content.c_str() + ); + } + } - TSNode root_node = ts_tree_root_node(new_tree); - const char *node_string = ts_node_string(root_node); - string result(node_string); - ts_free((void *)node_string); - AssertThat(result, Equals(entry.tree_string)); + // Reparse the restored code incrementally. + new_tree = ts_parser_parse(parser, tree, input.input()); + assert_consistent_tree_sizes(new_tree, input.content); - ts_tree_delete(tree); - ts_tree_delete(new_tree); - delete input; - }); - } + // Verify that the correct ranges have been marked as changed. + ranges = ts_tree_get_changed_ranges(tree, new_tree, &range_count); + old_scope_sequence = build_scope_sequence(tree, input.content); + new_scope_sequence = build_scope_sequence(new_tree, input.content); + verify_changed_ranges( + old_scope_sequence, new_scope_sequence, + input.content, ranges, range_count + ); + ts_free(ranges); + ts_tree_delete(tree); + tree = new_tree; - if (deletions.insert({edit_position, deletion_size}).second) { - it(("parses " + entry.description + - ": repairing a deletion of " + - to_string(edit_position) + "-" + to_string(edit_position + deletion_size)).c_str(), [&]() { - input = new SpyInput(entry.input, 3); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); - - input->replace(edit_position, deletion_size, ""); - TSTree *tree = ts_parser_parse(parser, nullptr, input->input()); - assert_consistent_tree_sizes(tree, input->content); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); - - TSInputEdit edit = input->undo(); - ts_tree_edit(tree, &edit); - assert_consistent_tree_sizes(tree, input->content); - if (debug_graphs_enabled) printf("%s\n\n", input->content.c_str()); - - TSTree *new_tree = ts_parser_parse(parser, tree, input->input()); - assert_consistent_tree_sizes(new_tree, input->content); - - uint32_t range_count; - TSRange *ranges = ts_tree_get_changed_ranges(tree, new_tree, &range_count); - - ScopeSequence old_scope_sequence = build_scope_sequence(tree, input->content); - ScopeSequence new_scope_sequence = build_scope_sequence(new_tree, input->content); - verify_changed_ranges( - old_scope_sequence, new_scope_sequence, - input->content, ranges, range_count - ); - ts_free(ranges); - - TSNode root_node = ts_tree_root_node(new_tree); - const char *node_string = ts_node_string(root_node); - string result(node_string); - ts_free((void *)node_string); - AssertThat(result, Equals(entry.tree_string)); - - ts_tree_delete(tree); - ts_tree_delete(new_tree); - delete input; - }); - } + // Verify that the final tree matches the expectation from the corpus. + AssertThat(to_string(tree), Equals(entry.tree_string)); + ts_tree_delete(tree); + }); } } }); } -END_TEST +END_TEST; diff --git a/test/runtime/node_test.cc b/test/runtime/node_test.cc index 3a856403..0deb311c 100644 --- a/test/runtime/node_test.cc +++ b/test/runtime/node_test.cc @@ -650,13 +650,14 @@ describe("Node", [&]() { it("updates the node's start position according to edit - random edits", [&]() { SpyInput input(json_string, 3); + Generator random(TREE_SITTER_SEED); for (unsigned i = 0; i < 10; i++) { auto nodes_before = get_all_nodes(); - size_t edit_start = default_generator(input.content.size()); - size_t deletion_size = default_generator(2) ? 0 : default_generator(input.content.size() - edit_start); - string inserted_text = default_generator.words(default_generator(4) + 1); + size_t edit_start = random(input.content.size()); + size_t deletion_size = random(2) ? 0 : random(input.content.size() - edit_start); + string inserted_text = random.words(random(4) + 1); TSInputEdit edit = input.replace(edit_start, deletion_size, inserted_text); ts_tree_edit(tree, &edit); diff --git a/test/runtime/subtree_test.cc b/test/runtime/subtree_test.cc index 3b5b145b..0adffe65 100644 --- a/test/runtime/subtree_test.cc +++ b/test/runtime/subtree_test.cc @@ -48,9 +48,9 @@ describe("Subtree", []() { ts_subtree_pool_delete(&pool); }); - auto new_leaf = [&](TSSymbol symbol, Length padding, Length size, uint32_t bytes_scanned) { + auto new_leaf = [&](TSSymbol symbol, Length padding, Length size, uint32_t lookahead_bytes) { return ts_subtree_new_leaf( - &pool, symbol, padding, size, bytes_scanned, 0, false, false, &language + &pool, symbol, padding, size, lookahead_bytes, 0, false, false, &language ); }; @@ -318,7 +318,7 @@ describe("Subtree", []() { describe("edits within a tree's range of scanned bytes", [&]() { it("marks preceding trees as changed", [&]() { MutableSubtree mutable_child = ts_subtree_to_mut_unsafe(tree.ptr->children[0]); - mutable_child.ptr->bytes_scanned = 7; + mutable_child.ptr->lookahead_bytes = 2; TSInputEdit edit; edit.start_byte = 6; @@ -408,7 +408,7 @@ describe("Subtree", []() { ts_subtree_symbol(leaf) + 1, ts_subtree_padding(leaf), ts_subtree_size(leaf), - ts_subtree_bytes_scanned(leaf) + ts_subtree_lookahead_bytes(leaf) ); AssertThat(ts_subtree_eq(leaf, different_leaf), IsFalse()); @@ -420,7 +420,7 @@ describe("Subtree", []() { ts_subtree_symbol(leaf), ts_subtree_padding(leaf), ts_subtree_size(leaf), - ts_subtree_bytes_scanned(leaf) + ts_subtree_lookahead_bytes(leaf) ); ts_subtree_to_mut_unsafe(different_leaf).ptr->visible = !ts_subtree_visible(leaf); AssertThat(ts_subtree_eq(leaf, different_leaf), IsFalse()); @@ -432,12 +432,12 @@ describe("Subtree", []() { ts_subtree_symbol(leaf), {}, ts_subtree_size(leaf), - ts_subtree_bytes_scanned(leaf) + ts_subtree_lookahead_bytes(leaf) ); AssertThat(ts_subtree_eq(leaf, different_leaf), IsFalse()); ts_subtree_release(&pool, different_leaf); - different_leaf = new_leaf(symbol1, ts_subtree_padding(leaf), {}, ts_subtree_bytes_scanned(leaf)); + different_leaf = new_leaf(symbol1, ts_subtree_padding(leaf), {}, ts_subtree_lookahead_bytes(leaf)); AssertThat(ts_subtree_eq(leaf, different_leaf), IsFalse()); ts_subtree_release(&pool, different_leaf); }); diff --git a/test/tests.cc b/test/tests.cc index 0d8c23e7..bf2dba40 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -12,7 +12,6 @@ int main(int argc, char *argv[]) { } printf("Random seed: %d\n", TREE_SITTER_SEED); - default_generator.reseed(TREE_SITTER_SEED); return bandit::run(argc, argv); }