mirror of
https://github.com/sharkdp/fd.git
synced 2026-10-12 02:22:28 +00:00
test: Don't fail on Windows without echo and GNU ls
`test_exec_with_separator` runs `echo`, which is only a shell builtin on Windows. Skip it there, like the other `echo` tests. `test_list_details` requires GNU `ls` on Windows. Without it, check that `--list-details` reports that it is not supported. Fixes #1332 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
committed by
Thayne McCombs
co-authored by
Claude Opus 5.5
parent
9e8927e8f3
commit
e46230b2c3
@@ -2110,6 +2110,7 @@ fn test_exec_batch_with_limit() {
|
||||
}
|
||||
|
||||
/// Shell script execution (--exec) with a custom --path-separator
|
||||
#[cfg(not(windows))] // Windows has no `echo` executable, only the shell builtin
|
||||
#[test]
|
||||
fn test_exec_with_separator() {
|
||||
let (te, abs_path) = get_test_env_with_abs_path(DEFAULT_DIRS, DEFAULT_FILES);
|
||||
@@ -2650,6 +2651,20 @@ fn test_exec_invalid_utf8() {
|
||||
fn test_list_details() {
|
||||
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
|
||||
|
||||
// On Windows, 'fd --list-details' needs GNU 'ls'.
|
||||
if cfg!(windows)
|
||||
&& std::process::Command::new("ls")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.is_err()
|
||||
{
|
||||
te.assert_failure_with_error(
|
||||
&["--list-details"],
|
||||
"[fd error]: 'fd --list-details' is not supported on Windows unless GNU 'ls' is installed.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure we can execute 'fd --list-details' without any errors.
|
||||
te.assert_success_and_get_output(".", &["--list-details"]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user