Add comprehensive ripgrep compatibility tests - #84
Merged
Conversation
Shengyu Fu (shengyfu)
force-pushed
the
shengyfu/ripgrep-compat-tests
branch
from
May 9, 2026 00:12
e1cf2d1 to
4db670c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a large set of new integration tests to improve tgrep CLI compatibility coverage with ripgrep-style flags, primarily exercising behavior under --no-index (brute-force) execution.
Changes:
- Expands
tgrep-cli/tests/ripgrep_compat.rswith many new tests covering common ripgrep flags (case handling, fixed strings, word boundary, invert match, context, JSON, vimgrep, trim, null separators, ignore/hidden, and combinations). - Adds additional edge-case and exit-code assertions.
Show a summary per file
| File | Description |
|---|---|
tgrep-cli/tests/ripgrep_compat.rs |
Adds extensive ripgrep-compatibility integration tests across many CLI flags and flag interactions. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
tgrep-cli/tests/ripgrep_compat.rs:1968
- Same as above: the
git initprecondition is ignored here. If initialization fails,-umay behave differently (since there’s no repo/.gitignore), making this test environment-dependent. Please assertgit initsucceeded (or skip whengitis unavailable).
.assert()
.success()
.stdout(predicate::str::contains("unrestricted secret"));
}
- Files reviewed: 1/1 changed files
- Comments generated: 2
Shengyu Fu (shengyfu)
force-pushed
the
shengyfu/ripgrep-compat-tests
branch
from
May 9, 2026 00:20
4db670c to
b974d87
Compare
Add 74 new integration tests to ripgrep_compat.rs (from 41 to 115), covering ripgrep-compatible CLI flags that were previously untested: Brute-force (--no-index) tests: - Case-insensitive (-i), smart case (-S), fixed strings (-F) - Word boundary (-w), invert match (-v), only matching (-o) - Max count (-m), count (-c), files with matches (-l) - Multiple patterns (-e), pattern file (-f) - Context lines (-A/-B/-C) with separator verification - JSON output (--json), vimgrep output (--vimgrep) - Trim (--trim), null separator (-0), heading (--no-heading) - Color (--color never), hidden (--hidden), no-ignore (--no-ignore) - Unrestricted (-u/-uu), glob negation (!pattern) - Combined flag interactions, exit codes, edge cases Indexed search tests (16 tests): - Build a trigram index first, then verify the same flags produce correct results through the index path (no --no-index) - Covers: basic search, case-insensitive, fixed strings, word boundary, invert match, files-with/without-match, count, quiet, glob filter, only matching, max count, context lines, JSON output, smart case, and output suppression flags Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Shengyu Fu (shengyfu)
force-pushed
the
shengyfu/ripgrep-compat-tests
branch
from
May 9, 2026 00:29
b974d87 to
34f251a
Compare
baopingz
approved these changes
May 9, 2026
msftsiwei
approved these changes
May 9, 2026
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 58 new integration tests to \ grep-cli/tests/ripgrep_compat.rs\ (from 41 → 99 tests), covering ripgrep-compatible CLI flags that were previously untested or weakly tested.
New test coverage
All 199 workspace tests pass, clippy is clean.