grep: cover zero-width EOF only-matching behavior#44
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
cde7ac3 to
7c24ede
Compare
| // Searching at EOF is still meaningful for zero-width patterns such as | ||
| // `$` and `x*`. After emitting one, `offset` is nudged past EOF below. |
There was a problem hiding this comment.
While I'm grateful for your other PRs, do you not review them?
There was a problem hiding this comment.
You are right to push back here. I re-reviewed the diff and the implementation was already allowing the EOF search because Cursor::refill stops only once offset > line.len(). That means the original PR title/comment overstated the change: the useful part of this PR is regression coverage, not a behavior fix.
I removed the source comment and retitled the PR to make that scope explicit. The branch now only adds tests for -o/-v zero-width EOF behavior ($ and x*). Focused validation after the update: cargo test --test test_grep only_matching.
There was a problem hiding this comment.
You are right to push back here.
😭
lhecker
left a comment
There was a problem hiding this comment.
Thank you for the improved test coverage.
Frankly, I'd appreciate if a human would communicate with me, however. No matter what language or style.
Closes #28.
Summary
offset == line.len()so EOF zero-width matches can be observed-o/-o -vregressions for$andx*on empty lines