(t *testing.T)
| 552 | } |
| 553 | |
| 554 | func TestManagerUpdateWorktreeInfo(t *testing.T) { |
| 555 | tmpDir := t.TempDir() |
| 556 | prdPath := createTestPRDWithName(t, tmpDir, "test-prd") |
| 557 | |
| 558 | m := NewManager(10, testProvider) |
| 559 | m.Register("test-prd", prdPath) |
| 560 | |
| 561 | // Initially no worktree info |
| 562 | inst := m.GetInstance("test-prd") |
| 563 | if inst.WorktreeDir != "" || inst.Branch != "" { |
| 564 | t.Error("expected empty worktree info initially") |
| 565 | } |
| 566 | |
| 567 | // Update worktree info |
| 568 | if err := m.UpdateWorktreeInfo("test-prd", "/tmp/wt/test", "chief/test"); err != nil { |
| 569 | t.Fatalf("unexpected error: %v", err) |
| 570 | } |
| 571 | |
| 572 | inst = m.GetInstance("test-prd") |
| 573 | if inst.WorktreeDir != "/tmp/wt/test" { |
| 574 | t.Errorf("expected WorktreeDir /tmp/wt/test, got %s", inst.WorktreeDir) |
| 575 | } |
| 576 | if inst.Branch != "chief/test" { |
| 577 | t.Errorf("expected Branch chief/test, got %s", inst.Branch) |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | func TestManagerUpdateWorktreeInfoNotFound(t *testing.T) { |
| 582 | m := NewManager(10, testProvider) |
nothing calls this directly
no test coverage detected