aboutsummaryrefslogtreecommitdiff
path: root/flag_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'flag_test.go')
-rw-r--r--flag_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/flag_test.go b/flag_test.go
index 7d114b2..b5956fa 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -184,6 +184,7 @@ func TestShorthand(t *testing.T) {
boolaFlag := f.BoolP("boola", "a", false, "bool value")
boolbFlag := f.BoolP("boolb", "b", false, "bool2 value")
boolcFlag := f.BoolP("boolc", "c", false, "bool3 value")
+ booldFlag := f.BoolP("boold", "d", false, "bool4 value")
stringaFlag := f.StringP("stringa", "s", "0", "string value")
stringzFlag := f.StringP("stringz", "z", "0", "string value")
extra := "interspersed-argument"
@@ -194,6 +195,7 @@ func TestShorthand(t *testing.T) {
"-cs",
"hello",
"-z=something",
+ "-d=true",
"--",
notaflag,
}
@@ -213,6 +215,9 @@ func TestShorthand(t *testing.T) {
if *boolcFlag != true {
t.Error("boolc flag should be true, is ", *boolcFlag)
}
+ if *booldFlag != true {
+ t.Error("boold flag should be true, is ", *booldFlag)
+ }
if *stringaFlag != "hello" {
t.Error("stringa flag should be `hello`, is ", *stringaFlag)
}