Skip to content
Myr

test: add regression test for fixed bug

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

It turns out that #2094 was fixed in my `--max-count` refactor a few commits back. This commit adds a regression test for it. Closes #2094

authored by Andrew Gallant · committed by Andrew Gallant · parent f0faa91 · Browse files · 2 files+26 added−1 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+26 added−1 removed

  • tests:+24 added−0 removed
  • other:+2 added−1 removed

2 files+26 added−1 removed

modified:tests/regression.rs+24 added
1302 unmodified lines
1303 // happen when each match needs to be detected.1304 eqnice!("1:\n2:\n2:\n2:\n", cmd.args(&["-won", "", "test"]).stdout());1305});13061307// See: https://github.com/BurntSushi/ripgrep/issues/20941308rgtest!(r2094, |dir: Dir, mut cmd: TestCommand| {1309 dir.create("haystack", "a\nb\nc\na\nb\nc");1310 cmd.args(&[1311 "--no-line-number",1312 "--no-filename",1313 "--multiline",1314 "--max-count=1",1315 "--passthru",1316 "--replace=B",1317 "b",1318 "haystack",1319 ]);1320 let expected = "\1321a1322B1323c1324a1325b1326c1327";1328 eqnice!(expected, cmd.stdout());1329});13301331// See: https://github.com/BurntSushi/ripgrep/issues/20951332rgtest!(r2095, |dir: Dir, mut cmd: TestCommand| {1333 dir.create(1334 "test",
322 unmodified lines
modified:CHANGELOG.md+2 added-1 removed
27 unmodified lines
28* [BUG #2944](https://github.com/BurntSushi/ripgrep/pull/2944):29 Fix a bug where the "bytes searched" in `--stats` output could be incorrect.30* [BUG #2990](https://github.com/BurntSushi/ripgrep/issues/2990):31 Fix a bug where ripgrep would mishandle globs that ended with a `.`.32* [BUG #2094](https://github.com/BurntSushi/ripgrep/issues/2094),32* [BUG #3076](https://github.com/BurntSushi/ripgrep/issues/3076):33 [BUG #3076](https://github.com/BurntSushi/ripgrep/issues/3076):34 Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches.35* [BUG #3100](https://github.com/BurntSushi/ripgrep/pull/3100):36 Preserve line terminators when using `-r/--replace` flag.37* [BUG #3108](https://github.com/BurntSushi/ripgrep/issues/3108):
1750 unmodified lines