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

Function TestCommand_Bool

command_test.go:4206–4227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4204}
4205
4206func TestCommand_Bool(t *testing.T) {
4207 pCmd := &Command{
4208 Flags: []Flag{
4209 &BoolFlag{
4210 Name: "myflag",
4211 },
4212 },
4213 }
4214 cmd := &Command{
4215 Flags: []Flag{
4216 &BoolFlag{
4217 Name: "top-flag",
4218 Value: true,
4219 },
4220 },
4221 parent: pCmd,
4222 }
4223
4224 r := require.New(t)
4225 r.False(cmd.Bool("myflag"))
4226 r.True(cmd.Bool("top-flag"))
4227}
4228
4229func TestCommand_Value(t *testing.T) {
4230 subCmd := &Command{

Callers

nothing calls this directly

Calls 1

BoolMethod · 0.95

Tested by

no test coverage detected