(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestRemoveWorktree(t *testing.T) { |
| 172 | t.Run("removes existing worktree", func(t *testing.T) { |
| 173 | dir := initTestRepo(t) |
| 174 | wtPath := filepath.Join(dir, "worktrees", "test-prd") |
| 175 | |
| 176 | if err := CreateWorktree(dir, wtPath, "chief/test-prd"); err != nil { |
| 177 | t.Fatalf("CreateWorktree() error = %v", err) |
| 178 | } |
| 179 | |
| 180 | err := RemoveWorktree(dir, wtPath) |
| 181 | if err != nil { |
| 182 | t.Fatalf("RemoveWorktree() error = %v", err) |
| 183 | } |
| 184 | |
| 185 | // Verify the directory is gone |
| 186 | if _, err := os.Stat(wtPath); !os.IsNotExist(err) { |
| 187 | t.Error("worktree directory still exists after removal") |
| 188 | } |
| 189 | }) |
| 190 | } |
| 191 | |
| 192 | func TestListWorktrees(t *testing.T) { |
| 193 | t.Run("lists worktrees including main", func(t *testing.T) { |
nothing calls this directly
no test coverage detected