Skip to content

Improve query predicate error handling and add Rust integration tests#139

Open
DavidBakerEffendi wants to merge 3 commits intobonede:mainfrom
DavidBakerEffendi:dave/harden-eq-neq
Open

Improve query predicate error handling and add Rust integration tests#139
DavidBakerEffendi wants to merge 3 commits intobonede:mainfrom
DavidBakerEffendi:dave/harden-eq-neq

Conversation

@DavidBakerEffendi
Copy link
Contributor

This pull request improves the robustness of query predicate evaluation and expands test coverage for the Rust language bindings.

Key changes include:

  • Predicate Validation: Updated TSQueryPredicate to throw an IllegalStateException when source bytes are missing or invalid during text-based predicate evaluation (e.g., #eq?, #match?). This replaces silent failures with explicit error reporting.
  • Rust Integration Tests: Added new integration tests in TreeSitterRustTest that verify complex query scenarios, including usage of #eq? and #not-eq? predicates on Rust attributes and macro derive names.
  • Enhanced Test Suite: Added unit tests in TSQueryPredicateTest to verify that the library correctly handles and reports missing source data.

These changes ensure that developers receive clear feedback when query execution environment is misconfigured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant