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

Function TestCommand_Set

command_test.go:4463–4478  ·  command_test.go::TestCommand_Set
(t *testing.T)

Source from the content-addressed store, hash-verified

4461}
4462
4463func TestCommand_Set(t *testing.T) {
4464 cmd := &Command{
4465 Flags: []Flag{
4466 &Int64Flag{
4467 Name: "int",
4468 Value: 5,
4469 },
4470 },
4471 }
4472 r := require.New(t)
4473
4474 r.False(cmd.IsSet("int"))
4475 r.NoError(cmd.Set("int", "1"))
4476 r.Equal(int64(1), cmd.Int64("int"))
4477 r.True(cmd.IsSet("int"))
4478}
4479
4480func TestCommand_Set_InvalidFlagAccessHandler(t *testing.T) {
4481 var flagName string

Callers

nothing calls this directly

Calls 3

IsSetMethod · 0.95
SetMethod · 0.95
Int64Method · 0.95

Tested by

no test coverage detected