summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-12-05 20:05:57 -0500
committerAndrew Gallant <jamslam@gmail.com>2016-12-05 20:05:57 -0500
commit7282706b4265317e762a5c77ee3ff3afd5baf9f5 (patch)
tree65f33329b3bf49b44e3efde8b4a89e95a92346e2 /tests
parent160f04894fea3fe47d1ce6231102aa52085bb4ef (diff)
Fix bug reading root symlink.
When give an explicit file path on the command line like `foo` where `foo` is a symlink, ripgrep should follow it even if `-L` isn't set. This is consistent with the behavior of `foo/`. Fixes #256
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
index 876ee407..37e9678d 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -945,6 +945,29 @@ clean!(regression_251, "привет", ".", |wd: WorkDir, mut cmd: Command| {
assert_eq!(lines, "foo:привет\nfoo:Привет\nfoo:ПрИвЕт\n");
});
+// See: https://github.com/BurntSushi/ripgrep/issues/256
+#[cfg(not(windows))]
+clean!(regression_256, "test", "foo", |wd: WorkDir, mut cmd: Command| {
+ wd.create_dir("bar");
+ wd.create("bar/baz", "test");
+ wd.link_dir("bar", "foo");
+
+ let lines: String = wd.stdout(&mut cmd);
+ assert_eq!(lines, "foo/baz:test\n");
+});
+
+// See: https://github.com/BurntSushi/ripgrep/issues/256
+#[cfg(not(windows))]
+clean!(regression_256_j1, "test", "foo", |wd: WorkDir, mut cmd: Command| {
+ wd.create_dir("bar");
+ wd.create("bar/baz", "test");
+ wd.link_dir("bar", "foo");
+ cmd.arg("-j1");
+
+ let lines: String = wd.stdout(&mut cmd);
+ assert_eq!(lines, "foo/baz:test\n");
+});
+
// See: https://github.com/BurntSushi/ripgrep/issues/7
sherlock!(feature_7, "-fpat", "sherlock", |wd: WorkDir, mut cmd: Command| {
wd.create("pat", "Sherlock\nHolmes");