From 4026a0d8d1f16aad8ef35efe396c24862a51257e Mon Sep 17 00:00:00 2001 From: Mostyn Bramley-Moore Date: Sat, 7 Nov 2020 22:10:24 +0100 Subject: [PATCH] fixup! Add word-wrap support, with wrap length provided by the user show that user-defined indented lines also work as expected --- help_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/help_test.go b/help_test.go index 6e758f8d30..e50d33e5f2 100644 --- a/help_test.go +++ b/help_test.go @@ -927,9 +927,13 @@ func TestWrappedHelp(t *testing.T) { Usage: "here's a sample App.Usage string long enough that it should be wrapped in this test", UsageText: "i'm not sure how App.UsageText differs from App.Usage, but this should also be wrapped in this test", // TODO: figure out how to make ArgsUsage appear in the help text, and test that - Description: "here's a sample App.Description string long enough that it should be wrapped in this test", + Description: `here's a sample App.Description string long enough that it should be wrapped in this test + +with a newline + and an indented line`, Copyright: `Here's a sample copyright text string long enough that it should be wrapped. Including newlines. + And also indented lines. And then another long line. Blah blah blah does anybody ever read these things?`, @@ -967,6 +971,9 @@ DESCRIPTION: App.Description string long enough that it should be wrapped in this test + + with a newline + and an indented line GLOBAL OPTIONS: --foo, -h here's a @@ -981,6 +988,7 @@ COPYRIGHT: text string long enough that it should be wrapped. Including newlines. + And also indented lines. And then another long line.