//go:build linux || darwin package terminal import "testing" func TestShellOrDefault(t *testing.T) { if got := shellOrDefault("/bin/zsh"); got != "/bin/zsh" { t.Errorf("shellOrDefault() = %q, want the shell asked for", got) } t.Setenv("SHELL", "/bin/ksh") if got := shellOrDefault(""); got != "/bin/ksh" { t.Errorf("shellOrDefault() = %q, want the user's own shell", got) } t.Setenv("SHELL", "") if got := shellOrDefault(""); got != "/bin/sh" { t.Errorf("shellOrDefault() = %q, want the fallback", got) } }