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

Function TestSubsetStdLibMerge

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

Source from the content-addressed store, hash-verified

495}
496
497func TestSubsetStdLibMerge(t *testing.T) {
498 _, err := NewCustomEnv(
499 Function("size", MemberOverload("string_size", []*Type{StringType}, IntType)),
500 StdLib(StdLibSubset(
501 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
502 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
503 }...),
504 )))
505 if err != nil {
506 t.Errorf("StdLib() subsetting failed to merge: %v", err)
507 }
508}
509
510func TestSubsetStdLibMergeError(t *testing.T) {
511 _, 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