mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
add test
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
1518c4ec16
commit
0d825361e6
@ -18,6 +18,9 @@ package cel
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/google/cel-go/common/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTypes_ListType(t *testing.T) {
|
||||
@ -77,3 +80,16 @@ func testValue(t *testing.T, id int64, val interface{}) *DynValue {
|
||||
}
|
||||
return dv
|
||||
}
|
||||
|
||||
func TestDeclTypeProvider_FindStructType(t *testing.T) {
|
||||
obj := NewObjectType("foo", map[string]*DeclField{
|
||||
"bar": NewDeclField("bar", StringType, true, nil, nil),
|
||||
})
|
||||
base := types.NewEmptyRegistry()
|
||||
provider := NewDeclTypeProvider(obj)
|
||||
provider, err := provider.WithTypeProvider(base)
|
||||
assert.NoError(t, err)
|
||||
wrappedType, found := provider.FindStructType("foo")
|
||||
assert.True(t, found)
|
||||
assert.Equal(t, types.TypeKind, wrappedType.Kind())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user