MCPcopy
hub / github.com/puma/puma-dev / TestStubCommandLineArgs_flagReset

Function TestStubCommandLineArgs_flagReset

dev/devtest/testutils_test.go:12–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10var fTribe = flag.Bool("cankickit", false, "Can I kick it?")
11
12func TestStubCommandLineArgs_flagReset(t *testing.T) {
13 StubCommandLineArgs()
14 assert.False(t, *fTribe)
15 StubCommandLineArgs("-cankickit")
16 assert.True(t, *fTribe)
17 StubCommandLineArgs("-cankickit=false")
18 assert.False(t, *fTribe)
19 StubCommandLineArgs("-cankickit=true")
20 assert.True(t, *fTribe)
21 StubCommandLineArgs()
22 assert.False(t, *fTribe)
23 StubCommandLineArgs("-cankickit")
24 assert.True(t, *fTribe)
25 StubCommandLineArgs()
26 assert.False(t, *fTribe)
27}
28
29func TestStubCommandLineArgs_argReset(t *testing.T) {
30 StubCommandLineArgs("one", "two")

Callers

nothing calls this directly

Calls 1

StubCommandLineArgsFunction · 0.85

Tested by

no test coverage detected