blob: 58efba297573723c5d3953da99d1e869204b9442 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package authors
import "testing"
func TestGetInitials(t *testing.T) {
for input, expectedOutput := range map[string]string{
"Jesse Duffield": "JD",
"Jesse Duffield Man": "JD",
"JesseDuffield": "Je",
"J": "J",
"六书六書": "六",
"書": "書",
"": "",
} {
output := getInitials(input)
if output != expectedOutput {
t.Errorf("Expected %s to be %s", output, expectedOutput)
}
}
}
|