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

Function TestParserExpressionSizeLimit

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

Source from the content-addressed store, hash-verified

4540}
4541
4542func TestParserExpressionSizeLimit(t *testing.T) {
4543 env := testEnv(t, ParserExpressionSizeLimit(10))
4544 _, iss := env.Parse("'greeting'")
4545 if iss.Err() != nil {
4546 t.Errorf("Parse('greeting') failed: %v", iss.Err())
4547 }
4548 _, iss = env.Parse("'greetings'")
4549 if !strings.Contains(iss.Err().Error(), "size exceeds limit") {
4550 t.Errorf("Parse('greetings') got unexpected error: %v", iss.Err())
4551 }
4552}
4553
4554func TestExpressionNodeLimit(t *testing.T) {
4555 tests := []struct {

Callers

nothing calls this directly

Calls 6

ErrMethod · 0.80
testEnvFunction · 0.70
ParseMethod · 0.65
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected