(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestMemoryTrackingDisabled(t *testing.T) { |
| 142 | env := testEnv(t, Variable("a", ListType(IntType))) |
| 143 | ast, iss := env.Compile(`a + a`) |
| 144 | if iss.Err() != nil { |
| 145 | t.Fatalf("env.Compile() failed: %v", iss.Err()) |
| 146 | } |
| 147 | program, err := env.Program(ast, EvalOptions(OptTrackState)) |
| 148 | if err != nil { |
| 149 | t.Fatalf("env.Program() failed: %v", err) |
| 150 | } |
| 151 | _, details, err := program.Eval(map[string]any{"a": []int64{1, 2}}) |
| 152 | if err != nil { |
| 153 | t.Fatalf("program.Eval() failed: %v", err) |
| 154 | } |
| 155 | if peak := details.PeakMemory(); peak != nil { |
| 156 | t.Errorf("EvalDetails.PeakMemory() got %d, wanted nil when tracking disabled", *peak) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestMemoryLimit(t *testing.T) { |
| 161 | tests := []struct { |
nothing calls this directly
no test coverage detected