add TestStripIndent
This commit is contained in:
parent
c7df292288
commit
7120b95731
1 changed files with 27 additions and 0 deletions
27
command/help_test.go
Normal file
27
command/help_test.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package command
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestStripIndent(t *testing.T) {
|
||||
type c struct {
|
||||
input string
|
||||
expected string
|
||||
}
|
||||
|
||||
cases := []c{
|
||||
{
|
||||
input: " --help Show help for command\n --version Show gh version",
|
||||
expected: "--help Show help for command\n--version Show gh version\n",
|
||||
},
|
||||
{
|
||||
input: " --help Show help for command\n -R, --repo OWNER/REPO Select another repository using the OWNER/REPO format",
|
||||
expected: " --help Show help for command\n-R, --repo OWNER/REPO Select another repository using the OWNER/REPO format",
|
||||
},
|
||||
}
|
||||
|
||||
for _, kase := range cases {
|
||||
eq(t, stripIndent(kase.input), kase.expected)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue