(t *testing.T)
| 1984 | } |
| 1985 | |
| 1986 | func TestWorktreeForBranchReturnsExactMatch(t *testing.T) { |
| 1987 | // Given worktrees for main and a nested feature branch |
| 1988 | worktrees := []Worktree{ |
| 1989 | {Path: "/path/to/main", Ref: "refs/heads/main"}, |
| 1990 | {Path: "/path/to/feature", Ref: "refs/heads/feature/one"}, |
| 1991 | } |
| 1992 | |
| 1993 | // When the nested feature branch is located |
| 1994 | worktree := WorktreeForBranch(worktrees, "feature/one") |
| 1995 | |
| 1996 | // Then its exact worktree is returned |
| 1997 | assert.Equal(t, &worktrees[1], worktree) |
| 1998 | } |
| 1999 | |
| 2000 | func TestWorktreeForBranchRejectsNonMatchingBranch(t *testing.T) { |
| 2001 | worktrees := []Worktree{ |
nothing calls this directly
no test coverage detected