summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2021-05-31 19:52:26 -0400
committerAndrew Gallant <jamslam@gmail.com>2021-05-31 21:51:18 -0400
commitfbb2cfed28d68b220e51c0fe8db9d89a4516aab6 (patch)
tree7aedccfa0176dd101c676786d228fe63728500a3 /tests
parentaf8b27ffae5440feae4632fcda2a20c4cbeea7d2 (diff)
printer: trim line terminator before doing replacements
This is basically the same bug as #1401, but applied to replacements instead of --only-matching. Fixes #1739
Diffstat (limited to 'tests')
-rw-r--r--tests/regression.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regression.rs b/tests/regression.rs
index cd14d5e4..c905e736 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -945,6 +945,13 @@ rgtest!(r1638, |dir: Dir, mut cmd: TestCommand| {
eqnice!("foo:1:1:x\n", cmd.arg("--column").arg("x").stdout());
});
+// See: https://github.com/BurntSushi/ripgrep/issues/1739
+rgtest!(r1739_replacement_lineterm_match, |dir: Dir, mut cmd: TestCommand| {
+ dir.create("test", "a\n");
+ cmd.args(&[r"-r${0}f", r".*", "test"]);
+ eqnice!("af\n", cmd.stdout());
+});
+
// See: https://github.com/BurntSushi/ripgrep/issues/1765
rgtest!(r1765, |dir: Dir, mut cmd: TestCommand| {
dir.create("test", "\n");