(t *testing.T)
| 333 | } |
| 334 | |
| 335 | func TestFramePushPop(t *testing.T) { |
| 336 | baseAct, err := NewActivation(map[string]any{"x": 1}) |
| 337 | if err != nil { |
| 338 | t.Fatalf("NewActivation(x) failed: %v", err) |
| 339 | } |
| 340 | childAct, err := NewActivation(map[string]any{"y": 2}) |
| 341 | if err != nil { |
| 342 | t.Fatalf("NewActivation(y) failed: %v", err) |
| 343 | } |
| 344 | |
| 345 | frame := mustNewExecutionFrame(t, baseAct) |
| 346 | defer frame.Close() |
| 347 | |
| 348 | childFrame := frame.Push(childAct) |
| 349 | if childFrame == nil { |
| 350 | t.Fatal("push() returned nil") |
| 351 | } |
| 352 | if childFrame.parent != frame { |
| 353 | t.Errorf("push() parent got %v, want %v", childFrame.parent, frame) |
| 354 | } |
| 355 | |
| 356 | popped := childFrame.Pop() |
| 357 | if popped != frame { |
| 358 | t.Errorf("pop() got %v, want %v", popped, frame) |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | func TestFrameClose(t *testing.T) { |
| 363 | frame := mustNewExecutionFrame(t, EmptyActivation()) |
nothing calls this directly
no test coverage detected