From a9fa767b09daf2d2c683870090c3a810e7c1b9fe Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 17 Oct 2014 18:23:31 -0700 Subject: [PATCH] commands/cli: Added test for detecting duplicate options --- commands/cli/parse_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/cli/parse_test.go b/commands/cli/parse_test.go index d9353544e..f42cab637 100644 --- a/commands/cli/parse_test.go +++ b/commands/cli/parse_test.go @@ -30,6 +30,11 @@ func TestOptionParsing(t *testing.T) { t.Error("Returned input was different than expected: %v", input) } + _, _, err = parseOptions([]string{ "-beep=1", "-boop=2", "-beep=3" }) + if err == nil { + t.Error("Should have failed (duplicate option name)") + } + path, args, err := parsePath([]string{ "test", "beep", "boop" }, cmd) if err != nil { t.Error("Should have passed")