(t *testing.T)
| 18 | } |
| 19 | |
| 20 | func TestUnknown(t *testing.T) { |
| 21 | cases := []struct { |
| 22 | opt OptionData |
| 23 | want WantedData |
| 24 | }{ |
| 25 | { |
| 26 | OptionData{"-bad", "Unknown option: -bad"}, |
| 27 | WantedData{None, "", 0, "Unknown option: -bad"}, |
| 28 | }, |
| 29 | } |
| 30 | for _, c := range cases { |
| 31 | gotOptionType, gotOptionValue, gotChomped, gotError := ArgToOption(c.opt.first, c.opt.second) |
| 32 | if gotOptionType != c.want.optionType { |
| 33 | t.Errorf("ParseOsArgs %q != %q", gotOptionType, c.want.optionType) |
| 34 | } else if gotOptionValue != c.want.value { |
| 35 | t.Errorf("ParseOsArgs %q != %q", gotOptionValue, c.want.value) |
| 36 | } else if gotChomped != c.want.chomped { |
| 37 | t.Errorf("ParseOsArgs %q != %q", gotChomped, c.want.chomped) |
| 38 | } else if gotError.Error() != c.want.errorMessage { |
| 39 | t.Errorf("ParseOsArgs %q != %q", gotError.Error(), c.want.errorMessage) |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestGet(t *testing.T) { |
| 45 | cases := []struct { |
nothing calls this directly
no test coverage detected