turbo-editors/turbo-corepublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-core.git
git clone ssh://git@rickub.com/turbo-editors/turbo-core.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

session_unix_test.go · 21 lines · 526 BGo Blame HistoryRaw
🛟 Updated. 28d5985 k33g 12h ago1//go:build linux || darwin
2
3package terminal
4
5import "testing"
6
7func TestShellOrDefault(t *testing.T) {
8 if got := shellOrDefault("/bin/zsh"); got != "/bin/zsh" {
9 t.Errorf("shellOrDefault() = %q, want the shell asked for", got)
10 }
11
12 t.Setenv("SHELL", "/bin/ksh")
13 if got := shellOrDefault(""); got != "/bin/ksh" {
14 t.Errorf("shellOrDefault() = %q, want the user's own shell", got)
15 }
16
17 t.Setenv("SHELL", "")
18 if got := shellOrDefault(""); got != "/bin/sh" {
19 t.Errorf("shellOrDefault() = %q, want the fallback", got)
20 }
21}