Add test for CEL reserved symbols without double underscore

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
This commit is contained in:
Omer Aplatony 2024-09-15 18:14:25 +03:00
parent e86f5c035e
commit 1b371d0d46

View File

@ -19,6 +19,7 @@ package cel
import (
"fmt"
"regexp"
"strings"
"testing"
fuzz "github.com/google/gofuzz"
@ -204,3 +205,12 @@ 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)
}
}
}