Add test for CEL reserved symbols without double underscore
Signed-off-by: Omer Aplatony <omerap12@gmail.com> Kubernetes-commit: 1b371d0d4693da66343aa7f8642a694ea318692d
This commit is contained in:
parent
76f1672b11
commit
81ab7e0c68
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue