Files
Gogs/internal/conf/static_test.go
ᴊᴏᴇ ᴄʜᴇɴ 59e9fa191b chore: remove all MIT license file headers (#8083)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2026-01-08 19:32:15 -05:00

32 lines
486 B
Go

package conf
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_i18n_DateLang(t *testing.T) {
c := &i18nConf{
dateLangs: map[string]string{
"en-US": "en",
"zh-CN": "zh",
},
}
tests := []struct {
lang string
want string
}{
{lang: "en-US", want: "en"},
{lang: "zh-CN", want: "zh"},
{lang: "jp-JP", want: "en"},
}
for _, test := range tests {
t.Run("", func(t *testing.T) {
assert.Equal(t, test.want, c.DateLang(test.lang))
})
}
}