aboutsummaryrefslogtreecommitdiff
path: root/flag_test.go
diff options
context:
space:
mode:
authorTomas Aschan <[email protected]>2025-06-01 11:27:42 +0200
committerGitHub <[email protected]>2025-06-01 11:27:42 +0200
commit8a6c85f2ae488081f953744f9edc414bac10ee45 (patch)
tree67d437afa7187f8a88e5bce056f48dc9d0eff667 /flag_test.go
parentbca0664b6991016400b98ac29aae5a73f926bd71 (diff)
parentf9b6619ed0e0d771f7812fea23cd8b514faf2b2d (diff)
Merge pull request #409 from ShawnJeffersonWang/master
fix: correct argument length check in FlagSet.Parse
Diffstat (limited to 'flag_test.go')
-rw-r--r--flag_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/flag_test.go b/flag_test.go
index aa2f434..ead0518 100644
--- a/flag_test.go
+++ b/flag_test.go
@@ -100,6 +100,12 @@ func TestEverything(t *testing.T) {
}
}
+func TestNoArgument(t *testing.T) {
+ if GetCommandLine().Parse([]string{}) != nil {
+ t.Error("parse failed for empty argument list")
+ }
+}
+
func TestUsage(t *testing.T) {
called := false
ResetForTesting(func() { called = true })