mirror of https://github.com/sharkdp/fd.git
Add test
This commit is contained in:
parent
0b7febc3b6
commit
4287cddc00
|
@ -161,9 +161,9 @@ fn run() -> Result<ExitCode> {
|
||||||
Some(CommandTemplate::new_batch(args)?)
|
Some(CommandTemplate::new_batch(args)?)
|
||||||
} else if matches.is_present("list-details") {
|
} else if matches.is_present("list-details") {
|
||||||
let color = matches.value_of("color").unwrap_or("auto");
|
let color = matches.value_of("color").unwrap_or("auto");
|
||||||
#[allow(unused)]
|
|
||||||
let color_arg = ["--color=", color].concat();
|
let color_arg = ["--color=", color].concat();
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
let gnu_ls = |command_name| {
|
let gnu_ls = |command_name| {
|
||||||
vec![
|
vec![
|
||||||
command_name,
|
command_name,
|
||||||
|
@ -222,12 +222,12 @@ fn run() -> Result<ExitCode> {
|
||||||
gnu_ls("ls")
|
gnu_ls("ls")
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow!(
|
return Err(anyhow!(
|
||||||
"'fd --list-details' is not supported on this platform."
|
"'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Err(anyhow!(
|
return Err(anyhow!(
|
||||||
"'fd --list-details' is not supported on Windows unless GNU 'ls' is installed."
|
"'fd --list-details' is not supported on this platform."
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1558,3 +1558,11 @@ fn test_exec_invalid_utf8() {
|
||||||
b"test_\xFEinvalid\n",
|
b"test_\xFEinvalid\n",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_list_details() {
|
||||||
|
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
|
||||||
|
|
||||||
|
// Make sure we can execute 'fd --list-details' without any errors.
|
||||||
|
te.assert_success_and_get_output(".", &["--list-details"]);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue