mirror of https://github.com/cbednarski/hostess
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
530 B
Go
27 lines
530 B
Go
package commands
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestStrPadRight(t *testing.T) {
|
|
|
|
type testCase struct {
|
|
Expected string
|
|
Output string
|
|
Name string
|
|
}
|
|
|
|
cases := []testCase{
|
|
{"", StrPadRight("", 0), "Zero-length no padding"},
|
|
{" ", StrPadRight("", 10), "Zero-length 10 padding"},
|
|
{"string", StrPadRight("string", 0), "6-length 0 padding"},
|
|
}
|
|
|
|
for _, test := range cases {
|
|
if test.Output != test.Expected {
|
|
t.Errorf("Failed case: %s\nExpected %q Found %q", test.Name, test.Expected, test.Output)
|
|
}
|
|
}
|
|
}
|