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

Function TestSubsetStdLibMerge

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

Source from the content-addressed store, hash-verified

599}
600
601func TestSubsetStdLibMerge(t *testing.T) {
602 _, err := NewCustomEnv(
603 Function("size", MemberOverload("string_size", []*Type{StringType}, IntType)),
604 StdLib(StdLibSubset(
605 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
606 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
607 }...),
608 )))
609 if err != nil {
610 t.Errorf("StdLib() subsetting failed to merge: %v", err)
611 }
612}
613
614func TestSubsetStdLibMergeError(t *testing.T) {
615 _, err := NewCustomEnv(

Callers

nothing calls this directly

Calls 7

NewLibrarySubsetFunction · 0.92
NewCustomEnvFunction · 0.85
StdLibFunction · 0.85
StdLibSubsetFunction · 0.85
AddIncludedFunctionsMethod · 0.80
FunctionFunction · 0.70
MemberOverloadFunction · 0.70

Tested by

no test coverage detected