diff options
Diffstat (limited to 'pkg/gui/presentation/authors/authors_test.go')
-rw-r--r-- | pkg/gui/presentation/authors/authors_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/gui/presentation/authors/authors_test.go b/pkg/gui/presentation/authors/authors_test.go new file mode 100644 index 000000000..58efba297 --- /dev/null +++ b/pkg/gui/presentation/authors/authors_test.go @@ -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) + } + } +} |