photoprism/pkg/txt/upperfirst_test.go
Michael Mayer eec31c4938 Text: Do not capitalize "van" in names and titles #2672
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-14 20:37:24 +02:00

22 lines
499 B
Go

package txt
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestUcFirst(t *testing.T) {
t.Run("photo-lover", func(t *testing.T) {
assert.Equal(t, "Photo-lover", UpperFirst("photo-lover"))
})
t.Run("cat", func(t *testing.T) {
assert.Equal(t, "Cat", UpperFirst("Cat"))
})
t.Run("KwaZulu natal", func(t *testing.T) {
assert.Equal(t, "KwaZulu natal", UpperFirst("KwaZulu natal"))
})
t.Run("empty string", func(t *testing.T) {
assert.Equal(t, "", UpperFirst(""))
})
}