Skip to content
Myr

test: add regression test for fixed gitignore bug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

I believe this was actually fixed by #2933. Closes #3067

authored by Andrew Gallant · committed by Andrew Gallant · parent 7c2161d · Browse files · 2 files+15 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−2 removed

  • tests:+13 added−1 removed
  • other:+2 added−1 removed

2 files+15 added−2 removed

modified:tests/regression.rs+13 added-1 removed
1457 unmodified lines
1458// See: https://github.com/BurntSushi/ripgrep/pull/29441459rgtest!(r2944_incorrect_bytes_searched, |dir: Dir, mut cmd: TestCommand| {1460 dir.create("haystack", "foo1\nfoo2\nfoo3\nfoo4\nfoo5\n");1461 let got = cmd.args(&["--stats", "-m2", "foo", "."]).stdout();1462 println!("{got}");1462 assert!(got.contains("10 bytes searched\n"));1463});14641465// See: https://github.com/BurntSushi/ripgrep/issues/2990
11 unmodified lines
1477 let got = dir.command().args(&["--files", "-g", "!asdf./"]).stdout();1478 eqnice!("asdf/foo\n", got);1479});14801481// See: https://github.com/BurntSushi/ripgrep/issues/30671482rgtest!(r3067_gitignore_error, |dir: Dir, mut cmd: TestCommand| {1483 dir.create(".git", "");1484 dir.create(".gitignore", "foobar/debug");1485 dir.create_dir("foobar/some/debug");1486 dir.create_dir("foobar/debug");1487 dir.create("foobar/some/debug/flag", "baz");1488 dir.create("foobar/debug/flag2", "baz");14891490 let got = cmd.arg("baz").stdout();1491 eqnice!("foobar/some/debug/flag:baz\n", got);1492});14931494// See: https://github.com/BurntSushi/ripgrep/issues/31081495rgtest!(r3108_files_without_match_quiet_exit, |dir: Dir, _: TestCommand| {1496 dir.create("yes-match", "abc");1497 dir.create("non-match", "xyz");
124 unmodified lines
modified:CHANGELOG.md+2 added-1 removed
12 unmodified lines
13 [BUG #2731](https://github.com/BurntSushi/ripgrep/issues/2731),14 [BUG #2747](https://github.com/BurntSushi/ripgrep/issues/2747),15 [BUG #2778](https://github.com/BurntSushi/ripgrep/issues/2778),16 [BUG #2836](https://github.com/BurntSushi/ripgrep/issues/2836),17 [BUG #2933](https://github.com/BurntSushi/ripgrep/pull/2933):17 [BUG #2933](https://github.com/BurntSushi/ripgrep/pull/2933),18 [BUG #3067](https://github.com/BurntSushi/ripgrep/pull/3067):19 Fix bug related to gitignores from parent directories.20* [BUG #1332](https://github.com/BurntSushi/ripgrep/issues/1332),21 [BUG #3001](https://github.com/BurntSushi/ripgrep/issues/3001):22 Make `rg -vf file` where `file` is empty match everything.
1763 unmodified lines