summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThilo Uttendorfer <tlo@sengaya.de>2022-08-29 22:32:29 +0200
committerAndrew Gallant <jamslam@gmail.com>2023-09-20 11:52:42 -0400
commitcad1f5fae2e4b48d8942add9dc4c950a170b5d2e (patch)
tree5514f64265ac263d219d3a4fd857d9cea7884e32 /tests
parent2198bd92faacef6e4a102fb96f1640a17a7c3ed2 (diff)
ignore: fix filtering when searching subdirectories
When searching subdirectories the path was not correctly built and included duplicate parts. This fix will remove the duplicate part if possible. Fixes #1757, Closes #2295
Diffstat (limited to 'tests')
-rw-r--r--tests/regression.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regression.rs b/tests/regression.rs
index 5ef741cf..91c37449 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -952,6 +952,19 @@ rgtest!(r1739_replacement_lineterm_match, |dir: Dir, mut cmd: TestCommand| {
eqnice!("af\n", cmd.stdout());
});
+// See: https://github.com/BurntSushi/ripgrep/issues/1757
+rgtest!(f1757, |dir: Dir, _: TestCommand| {
+ dir.create_dir("rust/target");
+ dir.create(".ignore", "rust/target");
+ dir.create("rust/source.rs", "needle");
+ dir.create("rust/target/rustdoc-output.html", "needle");
+
+ let args = &["--files-with-matches", "needle", "rust"];
+ eqnice!("rust/source.rs\n", dir.command().args(args).stdout());
+ let args = &["--files-with-matches", "needle", "./rust"];
+ eqnice!("./rust/source.rs\n", dir.command().args(args).stdout());
+});
+
// See: https://github.com/BurntSushi/ripgrep/issues/1765
rgtest!(r1765, |dir: Dir, mut cmd: TestCommand| {
dir.create("test", "\n");