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

Function TestSubsetStdLibMergeError

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

Source from the content-addressed store, hash-verified

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