mirror of
https://github.com/documize/community.git
synced 2025-07-19 05:09:42 +02:00
Ensure initials calculate correctly for Unicode via runes
This commit is contained in:
parent
b839a0753c
commit
e234471b1e
2 changed files with 4 additions and 2 deletions
|
@ -13,11 +13,13 @@ package stringutil
|
|||
|
||||
import "testing"
|
||||
|
||||
// go test github.com/documize/community/core/stringutil -run TestInitials
|
||||
func TestInitials(t *testing.T) {
|
||||
in(t, "Harvey", "Kandola", "HK")
|
||||
in(t, "Harvey", "", "H")
|
||||
in(t, "", "Kandola", "K")
|
||||
in(t, "", "", "")
|
||||
in(t, "Иванов", "Иванов", "ИИ")
|
||||
}
|
||||
|
||||
func in(t *testing.T, firstname, lastname, expecting string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue