Merge pull request #127375 from omerap12/issue_126311

Add test for CEL reserved symbols without double underscore
This commit is contained in:
Kubernetes Prow Robot 2025-01-14 11:52:32 -08:00 committed by GitHub
commit 165da9ad0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ package cel
import (
"fmt"
"regexp"
"strings"
"testing"
fuzz "github.com/google/gofuzz"
@ -204,3 +205,11 @@ func TestCanSkipRegex(t *testing.T) {
})
}
}
func TestCELReservedSymbolsNoDoubleUnderscore(t *testing.T) {
for symbol := range celReservedSymbols {
if strings.Contains(symbol, "__") {
t.Errorf("CEL reserved symbol '%s' contains '__', which is not allowed as it would interfere with escaping", symbol)
}
}
}