(t *testing.T)
| 221 | } |
| 222 | |
| 223 | func TestMultipleFlagOccurrences(t *testing.T) { |
| 224 | fooHelp := ` |
| 225 | usage: foo <flags> |
| 226 | |
| 227 | --help show help |
| 228 | --foo some stuff |
| 229 | --bar other stuff (see also --foo) |
| 230 | ` |
| 231 | |
| 232 | desc, err := ParseHelp([]string{"foo", "--help"}, fooHelp) |
| 233 | require.Nil(t, err) |
| 234 | |
| 235 | expected := datastore.HelpPage{ |
| 236 | ExecutablePath: "foo", |
| 237 | Completions: []datastore.Completion{ |
| 238 | {Flag: "--help"}, |
| 239 | {Flag: "--foo"}, |
| 240 | {Flag: "--bar"}, |
| 241 | }, |
| 242 | CheckSum: "1f32a5ebf4758e9a89fca0b0de6aed8761cf6f92", |
| 243 | } |
| 244 | require.Equal(t, expected, *desc) |
| 245 | } |
| 246 | |
| 247 | func TestJavaStyleInclusion(t *testing.T) { |
| 248 | fooHelp := ` |
nothing calls this directly
no test coverage detected