photoprism/internal/i18n/locales_test.go

21 lines
380 B
Go
Raw Normal View History

package i18n
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSetLocale(t *testing.T) {
assert.Equal(t, English, locale)
SetLocale("D")
assert.Equal(t, English, locale)
SetLocale("De")
assert.Equal(t, German, locale)
SetLocale("PL")
assert.Equal(t, Polish, locale)
SetLocale("")
assert.Equal(t, English, locale)
assert.Equal(t, Default, locale)
}