summaryrefslogtreecommitdiff
path: root/test/example_test.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-07 12:48:14 -0600
committerJeff Carr <[email protected]>2024-11-07 12:48:14 -0600
commitf92d210ca7316c0eb2f1743418fd4c8f1b29d625 (patch)
tree7c4b0690ec07a775ea87889b0c3e2886a4d4feea /test/example_test.go
parent6b165207953c96ccdcd31508521919752ae7de60 (diff)
parent438bbfff1edeb3e65a0af4d385151788a5306644 (diff)
Merge remote-tracking branch 'flint/master' into jcarrv1.5.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'test/example_test.go')
-rw-r--r--test/example_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/example_test.go b/test/example_test.go
index 4bd7632..9b72b90 100644
--- a/test/example_test.go
+++ b/test/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,17 +196,17 @@ func Example_helpPlaceholder() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)
// output:
-
// Usage: example [--optimize LEVEL] [--maxjobs N] SRC [DST [DST ...]]
-
+ //
// Positional arguments:
// SRC
// DST
-
+ //
// Options:
// --optimize LEVEL, -O LEVEL
// optimization level
@@ -235,6 +236,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 +274,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 +395,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 +419,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 +455,7 @@ func Example_subcommand() {
// This is only necessary when running inside golang's runnable example harness
mustParseExit = func(int) {}
+ mustParseOut = os.Stdout
MustParse(&args)