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