32 lines
673 B
Go
32 lines
673 B
Go
package entity
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestLocaleMap(t *testing.T) {
|
|
kindToStr := getLocaleKindToStringMap()
|
|
strToKind := getLocaleToKindMap()
|
|
|
|
assert := assert.New(t)
|
|
for locale := DimensionLocalUnspecified + 1; locale < dimensionLocalEnd; locale++ {
|
|
localeKinds, ok := kindToStr[locale]
|
|
assert.True(ok)
|
|
localeStrs, ok := strToKind[locale]
|
|
assert.True(ok)
|
|
|
|
assert.Equal(len(localeKinds), len(localeStrs))
|
|
|
|
for kindKey, kindValue := range localeKinds {
|
|
strKey := kindValue
|
|
strValue, ok := localeStrs[strKey]
|
|
assert.True(ok)
|
|
|
|
assert.Equal(kindKey, strValue)
|
|
assert.Equal(strKey, kindValue)
|
|
}
|
|
}
|
|
}
|