MCPcopy
hub / github.com/cli/cli / TestGetOrDefaultNonExistentKey

Function TestGetOrDefaultNonExistentKey

internal/config/config_test.go:67–76  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

65}
66
67func TestGetOrDefaultNonExistentKey(t *testing.T) {
68 // Given we have no top level configuration
69 cfg := newTestConfig()
70
71 // When we get a key that has no value
72 optionalEntry := cfg.GetOrDefault("", "non-existent-key")
73
74 // Then it returns a None variant
75 require.True(t, optionalEntry.IsNone(), "expected there to be no value")
76}
77
78func TestGetOrDefaultNonExistentHostSpecificKey(t *testing.T) {
79 // Given have no top level configuration

Callers

nothing calls this directly

Calls 3

newTestConfigFunction · 0.85
IsNoneMethod · 0.80
GetOrDefaultMethod · 0.65

Tested by

no test coverage detected