summaryrefslogtreecommitdiff
path: root/example_test.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2024-06-28 11:03:08 -0400
committerGitHub <[email protected]>2024-06-28 11:03:08 -0400
commitbee5cf5d7cc07c41b2a528052bfba0566b5069c0 (patch)
treed0157b78d82c7667de1973da81e8d108b1ed509a /example_test.go
parentdfca71d1594a749ef5e2203e84cfb5a1b8e9387b (diff)
parentaa844c7de9f0314b1fe66b9bdcc12090c7d0905e (diff)
Merge pull request #255 from hhromic/fix-254v1.5.1
Fix crash on errors in package-level `MustParse`
Diffstat (limited to 'example_test.go')
-rw-r--r--example_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/example_test.go b/example_test.go
index 4bd7632..d3622bf 100644
--- a/example_test.go
+++ b/example_test.go
@@ -163,6 +163,7 @@ func Example_helpText() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -195,6 +196,7 @@ func Example_helpPlaceholder() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -235,6 +237,7 @@ func Example_helpTextWithSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -272,6 +275,7 @@ func Example_helpTextWhenUsingSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -392,6 +396,7 @@ func Example_errorText() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -415,6 +420,7 @@ func Example_errorTextForSubcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
@@ -450,6 +456,7 @@ func Example_subcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)