-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[TST] Regex testing #4570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[TST] Regex testing #4570
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Comprehensive Regex Unit Tests and Property-Based Testing for Literal Expressions This PR introduces thorough unit and property-based (proptest) tests for the Rust regex literal expression implementation. Key updates include new test modules covering various literal matching scenarios, proptest strategies to generate random regex patterns and corresponding documents, and integration of these tests in blockfile metadata querying. Additional minor changes establish conversion traits for ChromaHir types and minor doc comment updates. Key Changes: Affected Areas: Potential Impact: Functionality: No changes to production code logic; only documentation and testing reliability are improved. Performance: Negligible, as all additions are test-only. No measurable runtime or memory impact outside test runs. Security: No security-relevant changes. Scalability: Testing improvements may detect future scalability or matching regressions in regex literal implementations. Review Focus: Testing Needed• Run Code Quality Assessmentrust/types/src/regex/literal_expr.rs: High; added tests are comprehensive and idiomatic. rust/types/src/regex/hir.rs: High; From/Into implementations are clear and aid testing. rust/types/src/strategies.rs: High; new test strategies well structured, uses proptest idioms correctly. rust/segment/src/blockfile_metadata.rs: High; property-testing setup is clear and well integrated. Best PracticesTesting: Type-Safety: Potential Issues• Proptests, especially those generating recursive regexes, might occasionally generate expressions that are slow to match or process. Aborting or limiting test complexity is advisable. This summary was automatically generated by @propel-code-bot |
d546d4b
to
0d02e9b
Compare
dedfbd1
to
3feb7e0
Compare
Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?