(t *testing.T)
| 5141 | } |
| 5142 | |
| 5143 | func TestJSONFieldNamesInvalidProvider(t *testing.T) { |
| 5144 | type wrapperRegistry struct { |
| 5145 | *types.Registry |
| 5146 | } |
| 5147 | reg, err := types.NewRegistry(types.JSONFieldNames(true)) |
| 5148 | if err != nil { |
| 5149 | t.Fatalf("types.NewRegistry() failed: %v", err) |
| 5150 | } |
| 5151 | wrapped := wrapperRegistry{Registry: reg} |
| 5152 | _, err = NewEnv(CustomTypeProvider(wrapped), CustomTypeAdapter(reg), JSONFieldNames(true)) |
| 5153 | if err == nil { |
| 5154 | t.Error("NewEnv() created a CEL environment successfully despite incompatible configs") |
| 5155 | } |
| 5156 | } |
| 5157 | |
| 5158 | // TODO: ideally testCostEstimator and testRuntimeCostEstimator would be shared in a test fixtures package |
| 5159 | type testCostEstimator struct { |
nothing calls this directly
no test coverage detected