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

Function TestSubsetStdLibMerge

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

Source from the content-addressed store, hash-verified

515}
516
517func TestSubsetStdLibMerge(t *testing.T) {
518 _, err := NewCustomEnv(
519 Function("size", MemberOverload("string_size", []*Type{StringType}, IntType)),
520 StdLib(StdLibSubset(
521 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
522 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
523 }...),
524 )))
525 if err != nil {
526 t.Errorf("StdLib() subsetting failed to merge: %v", err)
527 }
528}
529
530func TestSubsetStdLibMergeError(t *testing.T) {
531 _, 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