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

Function TestResolveInput_Workspace

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

Source from the content-addressed store, hash-verified

139}
140
141func 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
158func TestCanonicalRemote(t *testing.T) {
159 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