Add property-based coverage for inline date-sequence matching (#400) - #401
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Summary
WalkthroughAdd isolated property-based coverage for inline date-sequence matching, including generated separators and formats, valid prefixed sequences, empty input, near-miss variations, and incomplete sequences. ChangesDate-sequence matcher coverage
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 20✅ Passed checks (20 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Exercise every supported date layout with generated date components, Unicode whitespace separators, opening punctuation, and preceding token offsets. Reject empty and truncated sequences directly so the matching boundary is covered without changing production behaviour.
2cd2696 to
9039d7d
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Pair every generated date layout with equal-length negative cases for invalid components, separators, ordering, and opening punctuation. Ensure the properties reject a length-only matcher rather than merely checking five-token availability. Expand the test module documentation to explain its relationship to the inline span helper and shared date strategies.
Identify the property module as the test-only companion to `span_helpers`. Explain its use of shared `date_strategies` generators and the internal matcher contract it exists to verify.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/wrap/inline/span_helper_props.rs`:
- Around line 127-191: Decompose the assertion logic in
try_match_date_sequence_distinguishes_valid_dates_from_five_token_near_misses
into small helpers for non-date components, wrong separators, swapped order, and
wrong opener, each accepting the token slice, start index, and layout index as
appropriate. Keep the valid-match assertion in the loop, invoke the helpers from
the slimmer loop body, and preserve all existing assertions and diagnostic
messages.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: dea0466b-1be1-4215-adee-eb60e4de4ed5
📒 Files selected for processing (1)
src/wrap/inline/span_helper_props.rs
Decompose the coupled near-miss assertions in the five-token distinguishing property into four focused helpers for non-date components, wrong separators, swapped order, and wrong opener. Each accepts the token slice, start index, and (where relevant) the invalid opener plus layout index, returning a proptest result so the slimmer loop body can propagate failures with `?`. All assertions and diagnostic messages are preserved; production matcher behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
This branch adds focused property-based coverage for inline date-sequence matching. It exercises every supported date layout across generated date components, Unicode whitespace separators, accepted opening punctuation and preceding token offsets, while keeping production matching behaviour unchanged.
Each generated valid layout is coupled with equal-length negative cases for non-date components, invalid separators, incorrect token order and invalid opening punctuation. It also covers empty input and every incomplete sequence length directly. The test-only scope keeps this follow-up isolated from PR #395.
Closes #400.
Review walkthrough
Validation
make check-fmt: passedmake test: passedmake typecheck: passedmake lint: passed with Clippy warnings deniedcoderabbit review --agent: completed with zero findingsReferences