mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-09 09:22:48 +03:00
move author name colouring code into its own file
This commit is contained in:
20
pkg/gui/presentation/authors/authors_test.go
Normal file
20
pkg/gui/presentation/authors/authors_test.go
Normal file
@@ -0,0 +1,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)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user