Skip to content

Commit

Permalink
Update tests for mutiline descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gueckmooh committed May 28, 2021
1 parent ad76fcf commit b0d9075
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions argparse_test.go
Expand Up @@ -2691,3 +2691,27 @@ func TestCommandHelpSetSnameOnly(t *testing.T) {
t.Error("Help arugment names should have defaulted")
}
}

func TestCommandHelpMultiline(t *testing.T) {
expected := `usage: command [-h|--help] -s|--string "<value>"
Program with multiline
description.
Arguments:
-h --help Print help information
-s --string String argument example
on several lines
`

parser := NewParser("command", "Program with multiline\ndescription.")

parser.String("s", "string", &Options{Required: true, Help: "String argument example\non several lines"})

actual := parser.Help(nil)
if expected != actual {
t.Errorf("Expectations unmet. expected: %s, actual: %s", expected, actual)
}
}

0 comments on commit b0d9075

Please sign in to comment.