MCPcopy Create free account
hub / github.com/cli/cli / Test_ValidateValue

Function Test_ValidateValue

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

Source from the content-addressed store, hash-verified

200}
201
202func Test_ValidateValue(t *testing.T) {
203 err := ValidateValue("git_protocol", "sshpps")
204 assert.EqualError(t, err, "invalid value")
205
206 err = ValidateValue("git_protocol", "ssh")
207 assert.NoError(t, err)
208
209 err = ValidateValue("editor", "vim")
210 assert.NoError(t, err)
211
212 err = ValidateValue("clipboard", "sometimes")
213 assert.EqualError(t, err, "invalid value")
214
215 err = ValidateValue("clipboard", "enabled")
216 assert.NoError(t, err)
217
218 err = ValidateValue("got", "123")
219 assert.NoError(t, err)
220
221 err = ValidateValue("http_unix_socket", "really_anything/is/allowed/and/net.Dial\\(...\\)/will/ultimately/validate")
222 assert.NoError(t, err)
223}
224
225func Test_ValidateKey(t *testing.T) {
226 err := ValidateKey("invalid")

Callers

nothing calls this directly

Calls 1

ValidateValueFunction · 0.85

Tested by

no test coverage detected