summaryrefslogtreecommitdiff
path: root/src/flag/flag_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/flag/flag_test.go')
-rw-r--r--src/flag/flag_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/flag/flag_test.go b/src/flag/flag_test.go
index 2c0387269..8c88c8c27 100644
--- a/src/flag/flag_test.go
+++ b/src/flag/flag_test.go
@@ -251,6 +251,16 @@ func TestUserDefined(t *testing.T) {
}
}
+func TestUserDefinedForCommandLine(t *testing.T) {
+ const help = "HELP"
+ var result string
+ ResetForTesting(func() { result = help })
+ Usage()
+ if result != help {
+ t.Fatalf("got %q; expected %q", result, help)
+ }
+}
+
// Declare a user-defined boolean flag type.
type boolFlagVar struct {
count int