diff options
| author | Ali Mohammad Pur <[email protected]> | 2025-10-03 00:54:20 +0200 |
|---|---|---|
| committer | Ali Mohammad Pur <[email protected]> | 2025-10-05 10:56:11 +0200 |
| commit | 666b603e380566b3faf684b385848e6d9fc63004 (patch) | |
| tree | ff40d07565c686e57f51a8e41b9da6851e00759b /printusage_test.go | |
| parent | be274af2a6d762e76dcb020967844bbcf3b3dbd4 (diff) | |
Show 'correct' explicit bool value syntax in help
Diffstat (limited to 'printusage_test.go')
| -rw-r--r-- | printusage_test.go | 22 |
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) } } |
