MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestResolveInput_Workspace

Function TestResolveInput_Workspace

internal/diff/git_resolve_test.go:144–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

initRepoWithChangeFunction · 0.85
gitOutFunction · 0.85
NewWorkspaceProviderFunction · 0.85
ResolveInputMethod · 0.80

Tested by

no test coverage detected