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

Function TestSubsetStdLibMerge

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

Source from the content-addressed store, hash-verified

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