MCPcopy Create free account
hub / github.com/Azure/ARO-HCP / TestDetectShellFallback

Function TestDetectShellFallback

tooling/hcpctl/pkg/shell/shell_test.go:96–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestDetectShellFallback(t *testing.T) {
97 t.Run("returns valid shell or error", func(t *testing.T) {
98 shell, err := detectShell()
99
100 if runtime.GOOS == "windows" {
101 // Windows might error if no PowerShell available
102 if err == nil && shell == nil {
103 t.Error("Should not return nil shell without error")
104 }
105 } else {
106 // Unix should always succeed
107 if err != nil {
108 t.Errorf("Unix should not error: %v", err)
109 }
110 if shell == nil {
111 t.Error("Unix should never return nil shell")
112 }
113 }
114 })
115}
116
117func TestSetEnvironmentVariable(t *testing.T) {
118 tests := []struct {

Callers

nothing calls this directly

Calls 3

detectShellFunction · 0.85
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected