MCPcopy Index your code
hub / github.com/docker-exec/dexec / TestUnknown

Function TestUnknown

cli/cli_test.go:20–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18}
19
20func 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
44func TestGet(t *testing.T) {
45 cases := []struct {

Callers

nothing calls this directly

Calls 1

ArgToOptionFunction · 0.85

Tested by

no test coverage detected