mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
parent
a515c4d601
commit
229b8e3b33
@ -192,7 +192,9 @@ fn run_files_parallel(args: Arc<Args>) -> Result<u64> {
|
|||||||
let mut printer = print_args.printer(stdout.lock());
|
let mut printer = print_args.printer(stdout.lock());
|
||||||
let mut file_count = 0;
|
let mut file_count = 0;
|
||||||
for dent in rx.iter() {
|
for dent in rx.iter() {
|
||||||
printer.path(dent.path());
|
if !print_args.quiet() {
|
||||||
|
printer.path(dent.path());
|
||||||
|
}
|
||||||
file_count += 1;
|
file_count += 1;
|
||||||
}
|
}
|
||||||
file_count
|
file_count
|
||||||
@ -227,7 +229,9 @@ fn run_files_one_thread(args: Arc<Args>) -> Result<u64> {
|
|||||||
None => continue,
|
None => continue,
|
||||||
Some(dent) => dent,
|
Some(dent) => dent,
|
||||||
};
|
};
|
||||||
printer.path(dent.path());
|
if !args.quiet() {
|
||||||
|
printer.path(dent.path());
|
||||||
|
}
|
||||||
file_count += 1;
|
file_count += 1;
|
||||||
}
|
}
|
||||||
Ok(file_count)
|
Ok(file_count)
|
||||||
|
@ -1652,6 +1652,35 @@ fn regression_451_only_matching() {
|
|||||||
assert_eq!(lines, expected);
|
assert_eq!(lines, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/483
|
||||||
|
#[test]
|
||||||
|
fn regression_483_matching_no_stdout() {
|
||||||
|
let wd = WorkDir::new("regression_483_matching_no_stdout");
|
||||||
|
wd.create("file.py", "");
|
||||||
|
|
||||||
|
let mut cmd = wd.command();
|
||||||
|
cmd.arg("--quiet")
|
||||||
|
.arg("--files")
|
||||||
|
.arg("--glob").arg("*.py");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert!(lines.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/483
|
||||||
|
#[test]
|
||||||
|
fn regression_483_non_matching_exit_code() {
|
||||||
|
let wd = WorkDir::new("regression_483_non_matching_exit_code");
|
||||||
|
wd.create("file.rs", "");
|
||||||
|
|
||||||
|
let mut cmd = wd.command();
|
||||||
|
cmd.arg("--quiet")
|
||||||
|
.arg("--files")
|
||||||
|
.arg("--glob").arg("*.py");
|
||||||
|
|
||||||
|
wd.assert_err(&mut cmd);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn type_list() {
|
fn type_list() {
|
||||||
let wd = WorkDir::new("type_list");
|
let wd = WorkDir::new("type_list");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user