MCPcopy
hub / github.com/urfave/cli / TestStringMapFlagValueFromCommand

Function TestStringMapFlagValueFromCommand

flag_test.go:3258–3270  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3256}
3257
3258func TestStringMapFlagValueFromCommand(t *testing.T) {
3259 f := &StringMapFlag{Name: "myflag"}
3260 cmd := &Command{
3261 Flags: []Flag{
3262 f,
3263 },
3264 }
3265 assert.NoError(t, cmd.Run(buildTestContext(t), []string{""}))
3266 require.NoError(t, cmd.Set("myflag", "a=b"))
3267 require.NoError(t, cmd.Set("myflag", "c="))
3268
3269 require.Equal(t, map[string]string{"a": "b", "c": ""}, cmd.StringMap(f.Name))
3270}
3271
3272func TestStringMapFlagApply_Error(t *testing.T) {
3273 fl := StringMapFlag{Name: "goat"}

Callers

nothing calls this directly

Calls 4

RunMethod · 0.95
SetMethod · 0.95
StringMapMethod · 0.95
buildTestContextFunction · 0.85

Tested by

no test coverage detected