MCPcopy
hub / github.com/spf13/cobra / validOnlyWithInvalidArgs

Function validOnlyWithInvalidArgs

args_test.go:44–53  ·  args_test.go::validOnlyWithInvalidArgs
(err error, t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func validOnlyWithInvalidArgs(err error, t *testing.T) {
45 if err == nil {
46 t.Fatal("Expected an error")
47 }
48 got := err.Error()
49 expected := `invalid argument "a" for "c"`
50 if got != expected {
51 t.Errorf("Expected: %q, got: %q", expected, got)
52 }
53}
54
55func noArgsWithArgs(err error, t *testing.T, arg string) {
56 if err == nil {

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected