diff --git a/pkg/cel/library/cost_test.go b/pkg/cel/library/cost_test.go index 93566135a..280de1bc0 100644 --- a/pkg/cel/library/cost_test.go +++ b/pkg/cel/library/cost_test.go @@ -227,12 +227,36 @@ func TestStringLibrary(t *testing.T) { expectEsimatedCost: checker.CostEstimate{Min: 3, Max: 3}, expectRuntimeCost: 3, }, + { + name: "lowerAsciiEquals", + expr: "'ABCDEFGHIJ abcdefghij'.lowerAscii() == 'abcdefghij ABCDEFGHIJ'.lowerAscii()", + expectEsimatedCost: checker.CostEstimate{Min: 7, Max: 9}, + expectRuntimeCost: 9, + }, { name: "upperAscii", expr: "'ABCDEFGHIJ abcdefghij'.upperAscii()", expectEsimatedCost: checker.CostEstimate{Min: 3, Max: 3}, expectRuntimeCost: 3, }, + { + name: "upperAsciiEquals", + expr: "'ABCDEFGHIJ abcdefghij'.upperAscii() == 'abcdefghij ABCDEFGHIJ'.upperAscii()", + expectEsimatedCost: checker.CostEstimate{Min: 7, Max: 9}, + expectRuntimeCost: 9, + }, + { + name: "quote", + expr: "strings.quote('ABCDEFGHIJ abcdefghij')", + expectEsimatedCost: checker.CostEstimate{Min: 3, Max: 3}, + expectRuntimeCost: 3, + }, + { + name: "quoteEquals", + expr: "strings.quote('ABCDEFGHIJ abcdefghij') == strings.quote('ABCDEFGHIJ abcdefghij')", + expectEsimatedCost: checker.CostEstimate{Min: 7, Max: 11}, + expectRuntimeCost: 9, + }, { name: "replace", expr: "'abc 123 def 123'.replace('123', '456')",