commands/cli: Added test for detecting duplicate options
Matt Bell committed
Oct 17, 2014 at 18:23 UTC
a9fa767b09daf2d2c683870090c3a810e7c1b9fe
1 file changed
+5
commands/cli/parse_test.go
+5
@@ -30,6 +30,11 @@ func TestOptionParsing(t *testing.T) {
30
t.Error("Returned input was different than expected: %v", input)
31
}
32
33
+ _, _, err = parseOptions([]string{ "-beep=1", "-boop=2", "-beep=3" })
34
+ if err == nil {
35
+ t.Error("Should have failed (duplicate option name)")
36
+ }
37
+
38
path, args, err := parsePath([]string{ "test", "beep", "boop" }, cmd)
39
if err != nil {
40
t.Error("Should have passed")