mirror of
https://github.com/sharkdp/fd
synced 2024-10-02 22:13:31 +00:00
Add test
This commit is contained in:
parent
0b7febc3b6
commit
4287cddc00
|
@ -161,9 +161,9 @@ fn run() -> Result<ExitCode> {
|
|||
Some(CommandTemplate::new_batch(args)?)
|
||||
} else if matches.is_present("list-details") {
|
||||
let color = matches.value_of("color").unwrap_or("auto");
|
||||
#[allow(unused)]
|
||||
let color_arg = ["--color=", color].concat();
|
||||
|
||||
#[allow(unused)]
|
||||
let gnu_ls = |command_name| {
|
||||
vec![
|
||||
command_name,
|
||||
|
@ -222,12 +222,12 @@ fn run() -> Result<ExitCode> {
|
|||
gnu_ls("ls")
|
||||
} else {
|
||||
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 {
|
||||
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",
|
||||
);
|
||||
}
|
||||
|
||||
#[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 a new issue