aboutsummaryrefslogtreecommitdiff
path: root/printusage_test.go
diff options
context:
space:
mode:
authorAli Mohammad Pur <[email protected]>2025-10-03 00:54:20 +0200
committerAli Mohammad Pur <[email protected]>2025-10-05 10:56:11 +0200
commit666b603e380566b3faf684b385848e6d9fc63004 (patch)
treeff40d07565c686e57f51a8e41b9da6851e00759b /printusage_test.go
parentbe274af2a6d762e76dcb020967844bbcf3b3dbd4 (diff)
Show 'correct' explicit bool value syntax in help
Diffstat (limited to 'printusage_test.go')
-rw-r--r--printusage_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/printusage_test.go b/printusage_test.go
index df982aa..076d13d 100644
--- a/printusage_test.go
+++ b/printusage_test.go
@@ -6,12 +6,12 @@ import (
"testing"
)
-const expectedOutput = ` --long-form Some description
- --long-form2 Some description
- with multiline
- -s, --long-name Some description
- -t, --long-name2 Some description with
- multiline
+const expectedOutput = ` --long-form[=true|false] Some description
+ --long-form2[=true|false] Some description
+ with multiline
+ -s, --long-name[=true|false] Some description
+ -t, --long-name2[=true|false] Some description with
+ multiline
`
func setUpPFlagSet(buf io.Writer) *FlagSet {
@@ -47,11 +47,11 @@ func setUpPFlagSet2(buf io.Writer) *FlagSet {
return f
}
-const expectedOutput2 = ` --long-form Some description
- --long-form2 Some description
+const expectedOutput2 = ` --long-form[=true|false] Some description
+ --long-form2[=true|false] Some description
with multiline
- -s, --long-name Some description
- -t, --long-name2 Some description with
+ -s, --long-name[=true|false] Some description
+ -t, --long-name2[=true|false] Some description with
multiline
-o, --other-very-long-arg string Some very long description having
break the limit (default
@@ -69,6 +69,6 @@ func TestPrintUsage_2(t *testing.T) {
f := setUpPFlagSet2(&buf)
res := f.FlagUsagesWrapped(80)
if res != expectedOutput2 {
- t.Errorf("Expected \n%q \nActual \n%q", expectedOutput2, res)
+ t.Errorf("Expected \n%s \nActual \n%s", expectedOutput2, res)
}
}