handle dimension
This commit is contained in:
31
internal/entity/dimension_inner_test.go
Normal file
31
internal/entity/dimension_inner_test.go
Normal file
@ -0,0 +1,31 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user