MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestSubsetStdLibMergeError

Function TestSubsetStdLibMergeError

cel/cel_test.go:614–625  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

612}
613
614func TestSubsetStdLibMergeError(t *testing.T) {
615 _, err := NewCustomEnv(
616 Function("size", MemberOverload("string_size", []*Type{StringType}, UintType)),
617 StdLib(StdLibSubset(
618 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
619 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
620 }...),
621 )))
622 if err == nil || !strings.Contains(err.Error(), "merge failed") {
623 t.Errorf("StdLib() subsetting got %v, wanted error 'merge failed'", err)
624 }
625}
626
627func TestCustomTypes(t *testing.T) {
628 reg := types.NewEmptyRegistry()

Callers

nothing calls this directly

Calls 9

NewLibrarySubsetFunction · 0.92
NewCustomEnvFunction · 0.85
StdLibFunction · 0.85
StdLibSubsetFunction · 0.85
AddIncludedFunctionsMethod · 0.80
FunctionFunction · 0.70
MemberOverloadFunction · 0.70
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected