(t *testing.T, version int, opts ...cel.EnvOption)
| 670 | } |
| 671 | |
| 672 | func testMathCostsEnv(t *testing.T, version int, opts ...cel.EnvOption) *cel.Env { |
| 673 | t.Helper() |
| 674 | var mathOpt cel.EnvOption |
| 675 | if version > 0 { |
| 676 | mathOpt = Math(MathVersion(uint32(version))) |
| 677 | } else { |
| 678 | mathOpt = Math() |
| 679 | } |
| 680 | baseOpts := []cel.EnvOption{ |
| 681 | mathOpt, |
| 682 | cel.EnableMacroCallTracking(), |
| 683 | } |
| 684 | env, err := cel.NewEnv(append(baseOpts, opts...)...) |
| 685 | if err != nil { |
| 686 | t.Fatalf("cel.NewEnv(Math()) failed: %v", err) |
| 687 | } |
| 688 | return env |
| 689 | } |
| 690 | |
| 691 | func TestMathCosts(t *testing.T) { |
| 692 | tests := []struct { |
no test coverage detected