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

Function Test_Help_Nil_Flags

help_test.go:225–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

223}
224
225func Test_Help_Nil_Flags(t *testing.T) {
226 oldFlag := HelpFlag
227 defer func() {
228 HelpFlag = oldFlag
229 }()
230 HelpFlag = nil
231
232 cmd := &Command{
233 Action: func(_ context.Context, cmd *Command) error {
234 return nil
235 },
236 }
237 out := new(bytes.Buffer)
238 cmd.Writer = out
239 _ = cmd.Run(buildTestContext(t), []string{"test"})
240 require.Len(t, out.String(), 0)
241}
242
243func Test_Version_Custom_Flags(t *testing.T) {
244 oldFlag := VersionFlag

Callers

nothing calls this directly

Calls 4

RunMethod · 0.95
buildTestContextFunction · 0.85
LenMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected