MCPcopy Create free account
hub / github.com/commander-cli/commander / TestNewTestCommandContextFromCli

Function TestNewTestCommandContextFromCli

pkg/app/app_test.go:10–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestNewTestCommandContextFromCli(t *testing.T) {
11 set := flag.NewFlagSet("verbose", 0)
12 set.Bool("verbose", true, "")
13 set.Bool("no-color", true, "")
14 set.Int("concurrent", 5, "")
15
16 context := &cli.Context{}
17 ctx := cli.NewContext(nil, set, context)
18
19 r := NewTestContextFromCli(ctx)
20
21 assert.True(t, r.Verbose)
22 assert.True(t, r.NoColor)
23 assert.Equal(t, 5, r.Concurrent)
24}

Callers

nothing calls this directly

Calls 1

NewTestContextFromCliFunction · 0.85

Tested by

no test coverage detected