diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d29940..8f0177d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,8 @@ Bug fixes: Fix a bug where the "bytes searched" in `--stats` output could be incorrect. * [BUG #2990](https://github.com/BurntSushi/ripgrep/issues/2990): Fix a bug where ripgrep would mishandle globs that ended with a `.`. -* [BUG #3076](https://github.com/BurntSushi/ripgrep/issues/3076): +* [BUG #2094](https://github.com/BurntSushi/ripgrep/issues/2094), + [BUG #3076](https://github.com/BurntSushi/ripgrep/issues/3076): Fix bug with `-m/--max-count` and `-U/--multiline` showing too many matches. * [BUG #3100](https://github.com/BurntSushi/ripgrep/pull/3100): Preserve line terminators when using `-r/--replace` flag. diff --git a/tests/regression.rs b/tests/regression.rs index f8308c23..f3ba63b0 100644 --- a/tests/regression.rs +++ b/tests/regression.rs @@ -1304,6 +1304,30 @@ rgtest!(r1891, |dir: Dir, mut cmd: TestCommand| { eqnice!("1:\n2:\n2:\n2:\n", cmd.args(&["-won", "", "test"]).stdout()); }); +// See: https://github.com/BurntSushi/ripgrep/issues/2094 +rgtest!(r2094, |dir: Dir, mut cmd: TestCommand| { + dir.create("haystack", "a\nb\nc\na\nb\nc"); + cmd.args(&[ + "--no-line-number", + "--no-filename", + "--multiline", + "--max-count=1", + "--passthru", + "--replace=B", + "b", + "haystack", + ]); + let expected = "\ +a +B +c +a +b +c +"; + eqnice!(expected, cmd.stdout()); +}); + // See: https://github.com/BurntSushi/ripgrep/issues/2095 rgtest!(r2095, |dir: Dir, mut cmd: TestCommand| { dir.create(