(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestResolveInput_Workspace(t *testing.T) { |
| 142 | repo := initRepoWithChange(t) // one commit + working-tree change |
| 143 | head := gitOut(t, repo, "rev-parse", "HEAD") |
| 144 | |
| 145 | p := NewWorkspaceProvider(repo, nil) |
| 146 | got := p.ResolveInput(context.Background()) |
| 147 | if got.ResolvedBase != head { |
| 148 | t.Errorf("ResolvedBase = %q, want HEAD %q", got.ResolvedBase, head) |
| 149 | } |
| 150 | if got.ResolvedHead != "" { |
| 151 | t.Errorf("ResolvedHead = %q, want empty (workspace has no immutable head)", got.ResolvedHead) |
| 152 | } |
| 153 | if got.ExactRange != "" { |
| 154 | t.Errorf("ExactRange = %q, want empty for workspace", got.ExactRange) |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | func TestCanonicalRemote(t *testing.T) { |
| 159 | cases := []struct { |
nothing calls this directly
no test coverage detected