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

Function TestBoolWithInverseNames

flag_bool_with_inverse_test.go:326–339  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

324}
325
326func TestBoolWithInverseNames(t *testing.T) {
327 flag := &BoolWithInverseFlag{
328 Name: "env",
329 Required: true,
330 }
331 names := flag.Names()
332
333 require.Len(t, names, 2)
334 require.Equal(t, "env", names[0], "expected first name to be `env`")
335 require.Equal(t, "no-env", names[1], "expected first name to be `no-env`")
336
337 var d DocGenerationFlag = flag
338 require.Equal(t, "bool", d.TypeName())
339}
340
341func TestBoolWithInverseString(t *testing.T) {
342 tcs := []struct {

Callers

nothing calls this directly

Calls 3

NamesMethod · 0.95
TypeNameMethod · 0.95
LenMethod · 0.65

Tested by

no test coverage detected