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

Function TestSubsetStdLibError

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

Source from the content-addressed store, hash-verified

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