1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-14 11:23:09 +02:00
lazygit/pkg/gui/presentation/authors/authors_test.go

21 lines
483 B
Go
Raw Normal View History

package authors
2021-10-23 09:17:35 +02:00
import "testing"
func TestGetInitials(t *testing.T) {
for input, expectedOutput := range map[string]string{
2021-10-23 09:17:35 +02:00
"Jesse Duffield": "JD",
"Jesse Duffield Man": "JD",
"JesseDuffield": "Je",
"J": "J",
"六书六書": "六",
"書": "書",
2021-10-23 09:17:35 +02:00
"": "",
} {
output := getInitials(input)
if output != expectedOutput {
t.Errorf("Expected %s to be %s", output, expectedOutput)
2021-10-23 09:17:35 +02:00
}
}
}