mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 14:23:37 +00:00
Add test for CEL reserved symbols without double underscore
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
This commit is contained in:
parent
e86f5c035e
commit
1b371d0d46
@ -19,6 +19,7 @@ package cel
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
fuzz "github.com/google/gofuzz"
|
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
Block a user