test: add regression test for fixed gitignore bug

I believe this was actually fixed by #2933.

Closes #3067
This commit is contained in:
Andrew Gallant
2025-10-10 20:58:54 -04:00
parent 7c2161d687
commit fa80aab6b0
2 changed files with 15 additions and 2 deletions

View File

@@ -1459,7 +1459,6 @@ rgtest!(r2658_null_data_line_regexp, |dir: Dir, mut cmd: TestCommand| {
rgtest!(r2944_incorrect_bytes_searched, |dir: Dir, mut cmd: TestCommand| {
dir.create("haystack", "foo1\nfoo2\nfoo3\nfoo4\nfoo5\n");
let got = cmd.args(&["--stats", "-m2", "foo", "."]).stdout();
println!("{got}");
assert!(got.contains("10 bytes searched\n"));
});
@@ -1479,6 +1478,19 @@ rgtest!(r2990_trip_over_trailing_dot, |dir: Dir, _cmd: TestCommand| {
eqnice!("asdf/foo\n", got);
});
// See: https://github.com/BurntSushi/ripgrep/issues/3067
rgtest!(r3067_gitignore_error, |dir: Dir, mut cmd: TestCommand| {
dir.create(".git", "");
dir.create(".gitignore", "foobar/debug");
dir.create_dir("foobar/some/debug");
dir.create_dir("foobar/debug");
dir.create("foobar/some/debug/flag", "baz");
dir.create("foobar/debug/flag2", "baz");
let got = cmd.arg("baz").stdout();
eqnice!("foobar/some/debug/flag:baz\n", got);
});
// See: https://github.com/BurntSushi/ripgrep/issues/3108
rgtest!(r3108_files_without_match_quiet_exit, |dir: Dir, _: TestCommand| {
dir.create("yes-match", "abc");