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

Function TestSubsetStdLibMergeError

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

Source from the content-addressed store, hash-verified

528}
529
530func TestSubsetStdLibMergeError(t *testing.T) {
531 _, err := NewCustomEnv(
532 Function("size", MemberOverload("string_size", []*Type{StringType}, UintType)),
533 StdLib(StdLibSubset(
534 env.NewLibrarySubset().AddIncludedFunctions([]*env.Function{
535 {Name: overloads.Size, Overloads: []*env.Overload{{ID: "string_size"}}},
536 }...),
537 )))
538 if err == nil || !strings.Contains(err.Error(), "merge failed") {
539 t.Errorf("StdLib() subsetting got %v, wanted error 'merge failed'", err)
540 }
541}
542
543func TestCustomTypes(t *testing.T) {
544 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