Tests for GetRepositoryRoot
(t *testing.T)
| 63 | // Tests for GetRepositoryRoot |
| 64 | |
| 65 | func TestGetRepositoryRoot_FromRepoRoot(t *testing.T) { |
| 66 | tmpDir := t.TempDir() |
| 67 | setupGitRepo(t, tmpDir) |
| 68 | |
| 69 | root, err := GetRepositoryRoot(tmpDir) |
| 70 | |
| 71 | require.NoError(t, err) |
| 72 | // Resolve symlinks for comparison (macOS /var -> /private/var) |
| 73 | resolvedTmp, _ := filepath.EvalSymlinks(tmpDir) |
| 74 | assert.Equal(t, resolvedTmp, root) |
| 75 | } |
| 76 | |
| 77 | func TestGetRepositoryRoot_FromSubdirectory(t *testing.T) { |
| 78 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected