(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestSuggestFlag(t *testing.T) { |
| 39 | // Given |
| 40 | app := buildExtendedTestCommand() |
| 41 | |
| 42 | for _, testCase := range []struct { |
| 43 | provided, expected string |
| 44 | }{ |
| 45 | {"", ""}, |
| 46 | {"a", "--another-flag"}, |
| 47 | {"hlp", "--help"}, |
| 48 | {"k", ""}, |
| 49 | {"s", "-s"}, |
| 50 | } { |
| 51 | // When |
| 52 | res := suggestFlag(app.Flags, testCase.provided, false) |
| 53 | |
| 54 | // Then |
| 55 | assert.Equal(t, testCase.expected, res) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func TestSuggestFlagHideHelp(t *testing.T) { |
| 60 | // Given |
nothing calls this directly
no test coverage detected