cli/command/help_test.go
2020-07-16 08:33:00 +09:00

27 lines
712 B
Go

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)
}
}