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

Function TestSubsetStdLibError

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

Source from the content-addressed store, hash-verified

485}
486
487func TestSubsetStdLibError(t *testing.T) {
488 _, err := NewCustomEnv(
489 StdLib(StdLibSubset(
490 env.NewLibrarySubset().AddIncludedMacros("has").AddExcludedMacros("exists")),
491 ))
492 if err == nil || !strings.Contains(err.Error(), "invalid subset") {
493 t.Errorf("StdLib() subsetting got %v, wanted error 'invalid subset'", err)
494 }
495}
496
497func TestSubsetStdLibMerge(t *testing.T) {
498 _, 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