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

Function TestParserExpressionSizeLimit

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

Source from the content-addressed store, hash-verified

3669}
3670
3671func TestParserExpressionSizeLimit(t *testing.T) {
3672 env := testEnv(t, ParserExpressionSizeLimit(10))
3673 _, iss := env.Parse("'greeting'")
3674 if iss.Err() != nil {
3675 t.Errorf("Parse('greeting') failed: %v", iss.Err())
3676 }
3677 _, iss = env.Parse("'greetings'")
3678 if !strings.Contains(iss.Err().Error(), "size exceeds limit") {
3679 t.Errorf("Parse('greetings') got unexpected error: %v", iss.Err())
3680 }
3681}
3682
3683func BenchmarkOptionalValues(b *testing.B) {
3684 env := testEnv(b,

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