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

Function rangeArgsWithInvalidCount

args_test.go:99–108  ·  view source on GitHub ↗
(err error, t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func rangeArgsWithInvalidCount(err error, t *testing.T) {
100 if err == nil {
101 t.Fatal("Expected an error")
102 }
103 got := err.Error()
104 expected := "accepts between 2 and 4 arg(s), received 1"
105 if got != expected {
106 t.Fatalf("Expected %q, got %q", expected, got)
107 }
108}
109
110// NoArgs
111

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected