MCPcopy
hub / github.com/cli/cli / TestMinimumNs_with_error

Function TestMinimumNs_with_error

pkg/cmdutil/args_test.go:35–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestMinimumNs_with_error(t *testing.T) {
36 tests := []struct {
37 N int
38 CustomMessage string
39 WantMessage string
40 }{
41 {
42 N: 1,
43 CustomMessage: "A custom msg",
44 WantMessage: "A custom msg",
45 },
46 {
47 N: 1,
48 CustomMessage: "",
49 WantMessage: "requires at least 1 arg(s), only received 0",
50 },
51 }
52
53 for _, test := range tests {
54 if got := MinimumArgs(test.N, test.CustomMessage)(nil, nil); got.Error() != test.WantMessage {
55 t.Errorf("Got: %v, Want: %v", got, test.WantMessage)
56 }
57 }
58}
59
60func TestPartition(t *testing.T) {
61 tests := []struct {

Callers

nothing calls this directly

Calls 3

MinimumArgsFunction · 0.85
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected