(t *testing.T)
| 129 | } |
| 130 | |
| 131 | func 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 | } |
nothing calls this directly
no test coverage detected