mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-04-24 17:12:16 +02:00
style nits
This commit is contained in:
parent
e96d93034a
commit
e8645dc8ae
@ -709,8 +709,8 @@ impl Args {
|
|||||||
/// Create a new recursive directory iterator at the path given.
|
/// Create a new recursive directory iterator at the path given.
|
||||||
pub fn walker(&self, path: &Path) -> Result<walk::Iter> {
|
pub fn walker(&self, path: &Path) -> Result<walk::Iter> {
|
||||||
// Always follow symlinks for explicitly specified files.
|
// Always follow symlinks for explicitly specified files.
|
||||||
let mut wd = WalkDir::new(path).follow_links(self.follow
|
let mut wd = WalkDir::new(path).follow_links(
|
||||||
|| path.is_file());
|
self.follow || path.is_file());
|
||||||
if let Some(maxdepth) = self.maxdepth {
|
if let Some(maxdepth) = self.maxdepth {
|
||||||
wd = wd.max_depth(maxdepth);
|
wd = wd.max_depth(maxdepth);
|
||||||
}
|
}
|
||||||
|
@ -567,25 +567,6 @@ baz/sherlock:be, to a very large extent, the result of luck. Sherlock Holmes
|
|||||||
assert_eq!(lines, path(expected));
|
assert_eq!(lines, path(expected));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Follow symlinks on explicit file arguments.
|
|
||||||
sherlock!(symlink_explicit_file, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
|
|
||||||
wd.link("sherlock", "sym1");
|
|
||||||
wd.link("sherlock", "sym2");
|
|
||||||
cmd.arg("sym1");
|
|
||||||
cmd.arg("sym2");
|
|
||||||
|
|
||||||
let lines: String = wd.stdout(&mut cmd);
|
|
||||||
let expected = "\
|
|
||||||
sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock
|
|
||||||
sherlock:be, to a very large extent, the result of luck. Sherlock Holmes
|
|
||||||
sym1:For the Doctor Watsons of this world, as opposed to the Sherlock
|
|
||||||
sym1:be, to a very large extent, the result of luck. Sherlock Holmes
|
|
||||||
sym2:For the Doctor Watsons of this world, as opposed to the Sherlock
|
|
||||||
sym2:be, to a very large extent, the result of luck. Sherlock Holmes
|
|
||||||
";
|
|
||||||
assert_eq!(lines, path(expected));
|
|
||||||
});
|
|
||||||
|
|
||||||
sherlock!(unrestricted1, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
|
sherlock!(unrestricted1, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
wd.create(".gitignore", "sherlock\n");
|
wd.create(".gitignore", "sherlock\n");
|
||||||
cmd.arg("-u");
|
cmd.arg("-u");
|
||||||
@ -801,6 +782,26 @@ clean!(regression_131, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
wd.assert_err(&mut cmd);
|
wd.assert_err(&mut cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/137
|
||||||
|
sherlock!(regression_137, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.link("sherlock", "sym1");
|
||||||
|
wd.link("sherlock", "sym2");
|
||||||
|
cmd.arg("sym1");
|
||||||
|
cmd.arg("sym2");
|
||||||
|
cmd.arg("-j1");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
let expected = "\
|
||||||
|
sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock
|
||||||
|
sherlock:be, to a very large extent, the result of luck. Sherlock Holmes
|
||||||
|
sym1:For the Doctor Watsons of this world, as opposed to the Sherlock
|
||||||
|
sym1:be, to a very large extent, the result of luck. Sherlock Holmes
|
||||||
|
sym2:For the Doctor Watsons of this world, as opposed to the Sherlock
|
||||||
|
sym2:be, to a very large extent, the result of luck. Sherlock Holmes
|
||||||
|
";
|
||||||
|
assert_eq!(lines, path(expected));
|
||||||
|
});
|
||||||
|
|
||||||
// See: https://github.com/BurntSushi/ripgrep/issues/20
|
// See: https://github.com/BurntSushi/ripgrep/issues/20
|
||||||
sherlock!(feature_20_no_filename, "Sherlock", ".",
|
sherlock!(feature_20_no_filename, "Sherlock", ".",
|
||||||
|wd: WorkDir, mut cmd: Command| {
|
|wd: WorkDir, mut cmd: Command| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user