Conversation
- protoc.rs: 7 tests for parse_protoc_output (single/multiple errors, empty/malformed input, partial format, non-numeric, colons in message) - nodekind.rs: 14 tests covering all NodeKind predicates against real tree-sitter parse trees - state.rs: 16 tests for get_content, get_tree, get_trees, get_trees_for_package, completion_items, find_workspace_symbols, delete_file, rename_file, upsert_content, parse_all_from_workspace, upsert_file - utils.rs: 6 new tests for ts_to_lsp_position, lsp_to_ts_point, round-trip, zero/large values, and additional split_identifier_package edge cases Also fixes a deadlock in rename_file() where the same RwLock write guard was acquired twice without dropping the first one. Signed-off-by: Ashar <ashar786khan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 43 new tests across 4 modules and fixes a deadlock bug discovered during testing.
Changes
src/protoc.rs — 7 tests for
parse_protoc_output: single error, multiple errors, empty output, malformed line, partial format, non-numeric line/col, message with colons.src/nodekind.rs — 14 tests covering all
NodeKindpredicates against real tree-sitter parse trees (is_identifier,is_message_name,is_enum_name,is_field_name,is_rpc_name,is_package_name,is_import_path,is_error,is_message,is_userdefined,is_renameable,is_field_decl_parent,is_actionable,to_symbolkind,as_str).src/state.rs — 16 tests for
get_content,get_tree,get_trees,get_trees_for_package,completion_items,find_workspace_symbols,delete_file,rename_file,upsert_content,parse_all_from_workspace,upsert_file.src/utils.rs — 6 new tests for
ts_to_lsp_position,lsp_to_ts_point, round-trip, zero/large values, and additionalsplit_identifier_packageedge cases.Bug fix
Fixed a deadlock in
rename_file()where the sameRwLockwrite guard was acquired twice without dropping the first one (theif let Some(v) = self.x.write().remove(...) { self.x.write().insert(...) }pattern).