diff --git a/WORKSPACE b/WORKSPACE index 133a6b8e..cbdf8cb3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -101,8 +101,8 @@ go_repository( go_repository( name = "dev_cel_expr", importpath = "cel.dev/expr", - sum = "h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4=", - version = "v0.19.1", + sum = "h1:V354PbqIXr9IQdwy4SYA4xa0HXaWq1BUPAGzugBY5V4=", + version = "v0.19.2", ) # local_repository( diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel index 4bca746d..f5c423b7 100644 --- a/conformance/BUILD.bazel +++ b/conformance/BUILD.bazel @@ -55,6 +55,13 @@ _TESTS_TO_SKIP = [ # Future enhancments. "enums/strong_proto2", "enums/strong_proto3", + + # Type deductions. + "type_deductions/wrappers/wrapper_promotion_2", + "type_deductions/legacy_nullable_types/null_assignable_to_message_parameter_candidate", + "type_deductions/legacy_nullable_types/null_assignable_to_duration_parameter_candidate", + "type_deductions/legacy_nullable_types/null_assignable_to_timestamp_parameter_candidate", + "type_deductions/legacy_nullable_types/null_assignable_to_abstract_parameter_candidate", ] go_test( diff --git a/conformance/go.mod b/conformance/go.mod index 65aa6edd..87a66f06 100644 --- a/conformance/go.mod +++ b/conformance/go.mod @@ -3,7 +3,7 @@ module github.com/google/cel-go/conformance go 1.21.1 require ( - cel.dev/expr v0.19.1 + cel.dev/expr v0.19.2 github.com/bazelbuild/rules_go v0.49.0 github.com/google/cel-go v0.21.0 github.com/google/go-cmp v0.6.0 diff --git a/conformance/go.sum b/conformance/go.sum index 8e4f4492..ed3e765c 100644 --- a/conformance/go.sum +++ b/conformance/go.sum @@ -1,9 +1,5 @@ -cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= -cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= -cel.dev/expr v0.19.0 h1:lXuo+nDhpyJSpWxpPVi5cPUwzKb+dsdOiw6IreM5yt0= -cel.dev/expr v0.19.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= -cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= -cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cel.dev/expr v0.19.2 h1:V354PbqIXr9IQdwy4SYA4xa0HXaWq1BUPAGzugBY5V4= +cel.dev/expr v0.19.2/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/bazelbuild/rules_go v0.49.0 h1:5vCbuvy8Q11g41lseGJDc5vxhDjJtfxr6nM/IC4VmqM= diff --git a/ext/formatting.go b/ext/formatting.go index 932d562e..c411a57d 100644 --- a/ext/formatting.go +++ b/ext/formatting.go @@ -67,8 +67,7 @@ func clauseForType(argType ref.Type) (clauseImpl, error) { if !ok { return "", fmt.Errorf("couldn't convert %s to float64", arg.Type().TypeName()) } - fmtStr := fmt.Sprintf("%%.%df", defaultPrecision) - return fmt.Sprintf(fmtStr, argDouble), nil + return strconv.FormatFloat(argDouble, 'f', -1, 64), nil }, nil case types.TypeType: return func(arg ref.Val, locale string) (string, error) { @@ -333,7 +332,7 @@ func (c *stringFormatter) Scientific(precision *int) func(ref.Val, string) (stri return "", fmt.Errorf("error matching locale: %w", err) } fmtStr := fmt.Sprintf("%%%de", *precision) - return message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), nil + return strings.ReplaceAll(message.NewPrinter(matchedLocale).Sprintf(fmtStr, argFloat), "\u202f", ""), nil } } diff --git a/ext/strings_test.go b/ext/strings_test.go index 22aab84e..a161889a 100644 --- a/ext/strings_test.go +++ b/ext/strings_test.go @@ -661,7 +661,7 @@ func TestStringFormat(t *testing.T) { name: "scientific notation formatting clause", format: "%.6e", formatArgs: "1052.032911275", - expectedOutput: "1.052033\u202f\u00d7\u202f10\u2070\u00b3", + expectedOutput: "1.052033\u00d710\u2070\u00b3", expectedRuntimeCost: 11, expectedEstimatedCost: checker.CostEstimate{Min: 11, Max: 11}, locale: "en_US", @@ -688,7 +688,7 @@ func TestStringFormat(t *testing.T) { name: "default precision for scientific notation", format: "%e", formatArgs: "2.71828", - expectedOutput: "2.718280\u202f\u00d7\u202f10\u2070\u2070", + expectedOutput: "2.718280\u00d710\u2070\u2070", expectedRuntimeCost: 11, expectedEstimatedCost: checker.CostEstimate{Min: 11, Max: 11}, locale: "en_US", @@ -733,7 +733,7 @@ func TestStringFormat(t *testing.T) { name: "unicode output for scientific notation", format: "unescaped unicode: %e, escaped unicode: %e", formatArgs: "2.71828, 2.71828", - expectedOutput: "unescaped unicode: 2.718280 × 10⁰⁰, escaped unicode: 2.718280\u202f\u00d7\u202f10\u2070\u2070", + expectedOutput: "unescaped unicode: 2.718280×10⁰⁰, escaped unicode: 2.718280\u00d710\u2070\u2070", expectedRuntimeCost: 15, expectedEstimatedCost: checker.CostEstimate{Min: 15, Max: 15}, locale: "en_US", @@ -996,7 +996,7 @@ func TestStringFormat(t *testing.T) { dynArgs: map[string]any{ "dynE": 2.71828, }, - expectedOutput: "(dyntype) e: 2.718280\u202f\u00d7\u202f10\u2070\u2070", + expectedOutput: "(dyntype) e: 2.718280\u00d710\u2070\u2070", expectedRuntimeCost: 13, expectedEstimatedCost: checker.CostEstimate{Min: 13, Max: 13}, locale: "en_US", diff --git a/go.mod b/go.mod index 7b976324..317c60c1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21.1 toolchain go1.23.0 require ( - cel.dev/expr v0.19.1 + cel.dev/expr v0.19.2 github.com/antlr4-go/antlr/v4 v4.13.0 github.com/stoewer/go-strcase v1.2.0 golang.org/x/text v0.16.0 diff --git a/go.sum b/go.sum index fdf55b76..2df9c0d3 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= -cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= -cel.dev/expr v0.19.0 h1:lXuo+nDhpyJSpWxpPVi5cPUwzKb+dsdOiw6IreM5yt0= -cel.dev/expr v0.19.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= -cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= -cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cel.dev/expr v0.19.2 h1:V354PbqIXr9IQdwy4SYA4xa0HXaWq1BUPAGzugBY5V4= +cel.dev/expr v0.19.2/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= diff --git a/vendor/modules.txt b/vendor/modules.txt index f1e3ce32..5e2390f3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# cel.dev/expr v0.19.1 +# cel.dev/expr v0.19.2 ## explicit; go 1.21.1 cel.dev/expr # github.com/antlr4-go/antlr/v4 v4.13.0