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

Function TestSubsetStdLibMergeError

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

Source from the content-addressed store, hash-verified

508}
509
510func TestSubsetStdLibMergeError(t *testing.T) {
511 _, err := NewCustomEnv(
512 Function("size", MemberOverload("string_size", []*Type{StringType}, UintType)),
513 StdLib(StdLibSubset(
514 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
515 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
516 }...),
517 )))
518 if err == nil || !strings.Contains(err.Error(), "merge failed") {
519 t.Errorf("StdLib() subsetting got %v, wanted error 'merge failed'", err)
520 }
521}
522
523func TestCustomTypes(t *testing.T) {
524 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