Skip to content

test_command_exists_known fails on Windows (asserts command_exists("ls")) #56

Description

@dmwyatt

platform::tests::test_command_exists_known asserts command_exists("ls"), but on Windows command_exists shells out to where.exe, and ls is not a real executable there (it is a PowerShell alias and a Git Bash builtin/coreutils binary that is not necessarily on PATH). The test comment even says "which itself should always exist on unix", so the assertion encodes a unix assumption.

Observed while working #52: cargo test on Windows 11 gives

test platform::tests::test_command_exists_known ... FAILED
assertion failed: command_exists("ls")

CI does not catch this because it runs on Linux.

Fix options: pick a command that exists on both platforms per cfg (e.g. where.exe itself on Windows, ls elsewhere), or gate the current assertion to #[cfg(unix)] with a Windows counterpart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersprio: p2Medium priority, normal queuesize: sSmall, quick fixstatus: readyReady to be worked ontype: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions