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

Function TestSuggestCommand

suggestions_test.go:131–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

129}
130
131func TestSuggestCommand(t *testing.T) {
132 // Given
133 app := buildExtendedTestCommand()
134
135 for _, testCase := range []struct {
136 provided, expected string
137 }{
138 {"", ""},
139 {"conf", "config"},
140 {"i", "i"},
141 {"information", "info"},
142 {"inf", "info"},
143 {"con", "config"},
144 {"not-existing", "info"},
145 } {
146 // When
147 res := suggestCommand(app.Commands, testCase.provided)
148
149 // Then
150 assert.Equal(t, testCase.expected, res)
151 }
152}

Callers

nothing calls this directly

Calls 2

buildExtendedTestCommandFunction · 0.85
suggestCommandFunction · 0.85

Tested by

no test coverage detected