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

Function TestSubsetStdLibError

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

Source from the content-addressed store, hash-verified

589}
590
591func TestSubsetStdLibError(t *testing.T) {
592 _, err := NewCustomEnv(
593 StdLib(StdLibSubset(
594 env.NewLibrarySubset().AddIncludedMacros("has").AddExcludedMacros("exists")),
595 ))
596 if err == nil || !strings.Contains(err.Error(), "invalid subset") {
597 t.Errorf("StdLib() subsetting got %v, wanted error 'invalid subset'", err)
598 }
599}
600
601func TestSubsetStdLibMerge(t *testing.T) {
602 _, 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