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

Function TestParseMultiBool

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

Source from the content-addressed store, hash-verified

2258}
2259
2260func TestParseMultiBool(t *testing.T) {
2261 _ = (&Command{
2262 Flags: []Flag{
2263 &BoolFlag{Name: "serve", Aliases: []string{"s"}},
2264 },
2265 Action: func(_ context.Context, cmd *Command) error {
2266 assert.True(t, cmd.Bool("serve"), "main name not set")
2267 assert.True(t, cmd.Bool("s"), "short name not set")
2268 return nil
2269 },
2270 }).Run(buildTestContext(t), []string{"run", "--serve"})
2271}
2272
2273func TestParseBoolShortOptionHandle(t *testing.T) {
2274 _ = (&Command{

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
BoolMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected