Skip to content
Myr

test: Don't fail on Windows without `echo` and GNU `ls`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

`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

authored by mrhard9090 · committed by Thayne McCombs · parent 9e8927e · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diff stats

1 file+15 added−0 removed

  • tests:+15 added−0 removed

1 file+15 added−0 removed

modified:tests/tests.rs+15 added
2108 unmodified lines
2109 );2110}21112112/// Shell script execution (--exec) with a custom --path-separator2113#[cfg(not(windows))] // Windows has no `echo` executable, only the shell builtin2114#[test]2115fn test_exec_with_separator() {2116 let (te, abs_path) = get_test_env_with_abs_path(DEFAULT_DIRS, DEFAULT_FILES);2117 te.assert_output(
532 unmodified lines
2650#[test]2651fn test_list_details() {2652 let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);26532654 // On Windows, 'fd --list-details' needs GNU 'ls'.2655 if cfg!(windows)2656 && std::process::Command::new("ls")2657 .arg("--version")2658 .output()2659 .is_err()2660 {2661 te.assert_failure_with_error(2662 &["--list-details"],2663 "[fd error]: 'fd --list-details' is not supported on Windows unless GNU 'ls' is installed.",2664 );2665 return;2666 }26672668 // Make sure we can execute 'fd --list-details' without any errors.2669 te.assert_success_and_get_output(".", &["--list-details"]);2670}2671
263 unmodified lines