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

Function TestCommand_String

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

Source from the content-addressed store, hash-verified

4178}
4179
4180func TestCommand_String(t *testing.T) {
4181 pCmd := &Command{
4182 Flags: []Flag{
4183 &StringFlag{
4184 Name: "myflag",
4185 Value: "hello world",
4186 },
4187 },
4188 }
4189 cmd := &Command{
4190 Flags: []Flag{
4191 &StringFlag{
4192 Name: "top-flag",
4193 Value: "hai veld",
4194 },
4195 },
4196 parent: pCmd,
4197 }
4198
4199 r := require.New(t)
4200 r.Equal("hello world", cmd.String("myflag"))
4201 r.Equal("hai veld", cmd.String("top-flag"))
4202
4203 r.Equal("hai veld", cmd.String("top-flag"))
4204}
4205
4206func TestCommand_Bool(t *testing.T) {
4207 pCmd := &Command{

Callers

nothing calls this directly

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected