turbo-editors/turbo-corepublic Fork 0
v1.0.1
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.

🛟 Updated. 28d5985 · on v1.0.1 · k33g · 14h ago
session_unix_test.go · 21 lines · 526 BGo Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
//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)
	}
}