MCPcopy
hub / github.com/cli/cli / Test_ValidateValue

Function Test_ValidateValue

pkg/cmd/config/set/set_test.go:161–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func Test_ValidateValue(t *testing.T) {
162 err := ValidateValue("git_protocol", "sshpps")
163 assert.EqualError(t, err, "invalid value")
164
165 err = ValidateValue("git_protocol", "ssh")
166 assert.NoError(t, err)
167
168 err = ValidateValue("editor", "vim")
169 assert.NoError(t, err)
170
171 err = ValidateValue("got", "123")
172 assert.NoError(t, err)
173
174 err = ValidateValue("http_unix_socket", "really_anything/is/allowed/and/net.Dial\\(...\\)/will/ultimately/validate")
175 assert.NoError(t, err)
176}
177
178func Test_ValidateKey(t *testing.T) {
179 err := ValidateKey("invalid")

Callers

nothing calls this directly

Calls 1

ValidateValueFunction · 0.85

Tested by

no test coverage detected