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

Function TestCommand_Args

command_test.go:4314–4328  ·  command_test.go::TestCommand_Args
(t *testing.T)

Source from the content-addressed store, hash-verified

4312}
4313
4314func TestCommand_Args(t *testing.T) {
4315 cmd := &Command{
4316 Flags: []Flag{
4317 &BoolFlag{
4318 Name: "myflag",
4319 },
4320 },
4321 }
4322 _ = cmd.Run(context.Background(), []string{"", "--myflag", "bat", "baz"})
4323
4324 r := require.New(t)
4325 r.Equal(2, cmd.Args().Len())
4326 r.True(cmd.Bool("myflag"))
4327 r.Equal(2, cmd.NArg())
4328}
4329
4330func TestCommand_IsSet(t *testing.T) {
4331 cmd := &Command{

Callers

nothing calls this directly

Calls 5

RunMethod · 0.95
ArgsMethod · 0.95
BoolMethod · 0.95
NArgMethod · 0.95
LenMethod · 0.65

Tested by

no test coverage detected