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

Function TestSubsetStdLibError

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

Source from the content-addressed store, hash-verified

505}
506
507func TestSubsetStdLibError(t *testing.T) {
508 _, err := NewCustomEnv(
509 StdLib(StdLibSubset(
510 env.NewLibrarySubset().AddIncludedMacros("has").AddExcludedMacros("exists")),
511 ))
512 if err == nil || !strings.Contains(err.Error(), "invalid subset") {
513 t.Errorf("StdLib() subsetting got %v, wanted error 'invalid subset'", err)
514 }
515}
516
517func TestSubsetStdLibMerge(t *testing.T) {
518 _, err := NewCustomEnv(

Callers

nothing calls this directly

Calls 8

NewLibrarySubsetFunction · 0.92
NewCustomEnvFunction · 0.85
StdLibFunction · 0.85
StdLibSubsetFunction · 0.85
AddExcludedMacrosMethod · 0.80
AddIncludedMacrosMethod · 0.80
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected