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

Function noArgsWithArgs

args_test.go:55–64  ·  args_test.go::noArgsWithArgs
(err error, t *testing.T, arg string)

Source from the content-addressed store, hash-verified

53}
54
55func noArgsWithArgs(err error, t *testing.T, arg string) {
56 if err == nil {
57 t.Fatal("Expected an error")
58 }
59 got := err.Error()
60 expected := `unknown command "` + arg + `" for "c"`
61 if got != expected {
62 t.Errorf("Expected: %q, got: %q", expected, got)
63 }
64}
65
66func minimumNArgsWithLessArgs(err error, t *testing.T) {
67 if err == nil {

Callers 3

TestNoArgs_WithArgsFunction · 0.85

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected