diff --git a/cli/tests/completion_install.rs b/cli/tests/completion_install.rs index 32c367fc3..70dbdd574 100644 --- a/cli/tests/completion_install.rs +++ b/cli/tests/completion_install.rs @@ -335,7 +335,12 @@ fn a_failed_install_says_what_the_system_said() { let scratch = Scratch::new("io_cause"); // A file where a directory has to go: deterministic, and the same failure for root, which is // who a container runs as. - let target = scratch.dir.join("data/zsh/site-functions"); + // + // Joined a segment at a time. `join("data/zsh/site-functions")` keeps the slashes it was + // given, so on Windows `display()` renders `…\data/zsh/site-functions` while the error + // being matched against says `…\data\zsh\site-functions` — the same path, spelled two + // ways, and the assertion below compares spellings. + let target = scratch.dir.join("data").join("zsh").join("site-functions"); std::fs::create_dir_all(target.parent().unwrap()).unwrap(); std::fs::write(&target, "not a directory\n").unwrap(); diff --git a/cli/tests/shell_completions_integration.rs b/cli/tests/shell_completions_integration.rs index a1126deb0..82de345f2 100644 --- a/cli/tests/shell_completions_integration.rs +++ b/cli/tests/shell_completions_integration.rs @@ -101,7 +101,11 @@ fn skip_if_shell_missing(shell: &str) -> bool { if shell_can_run_a_script(shell) { return false; } - if env::var("CI").is_ok_and(|v| !v.is_empty()) { + // Unix only. The workflow installs zsh and fish for the Linux job alone, so a shell missing + // there is a configuration bug and refusing to skip is what catches it. Nothing installs them + // on Windows, where their absence is the expected state rather than a mistake — mise draws the + // same line, installing no POSIX shells on its Windows runners at all. + if cfg!(unix) && env::var("CI").is_ok_and(|v| !v.is_empty()) { panic!("shell `{shell}` cannot run a script but CI is set — refusing to skip"); } eprintln!( @@ -178,7 +182,11 @@ fn bash_completion_or_skip() -> Option { if let Some(path) = system_bash_completion() { return Some(path); } - if env::var("CI").is_ok_and(|v| !v.is_empty()) { + // Unix only, for the same reason as `skip_if_shell_missing` and a stronger one: there is no + // bash-completion to install on Windows. Git for Windows does not ship the library, and usage + // stopped carrying its own copy in 6.0 (#1176) — so unlike a missing zsh, this is not a thing + // a runner could be configured to have. + if cfg!(unix) && env::var("CI").is_ok_and(|v| !v.is_empty()) { panic!( "no usable bash-completion but CI is set — refusing to skip. Tried: {:?}", bash_completion_candidates()