MCPcopy Create free account
hub / github.com/git-bug/git-bug / TestListLocalIds

Function TestListLocalIds

entity/dag/entity_actions_test.go:62–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestListLocalIds(t *testing.T) {
63 repoA, repoB, _, id1, id2, resolvers, def := makeTestContextRemote(t)
64
65 // A --> remote --> B
66 e := New(def)
67 e.Append(newOp1(id1, "foo"))
68 err := e.Commit(repoA)
69 require.NoError(t, err)
70
71 e = New(def)
72 e.Append(newOp2(id2, "bar"))
73 err = e.Commit(repoA)
74 require.NoError(t, err)
75
76 listLocalIds(t, def, repoA, 2)
77 listLocalIds(t, def, repoB, 0)
78
79 _, err = Push(def, repoA, "remote")
80 require.NoError(t, err)
81
82 _, err = Fetch(def, repoB, "remote")
83 require.NoError(t, err)
84
85 listLocalIds(t, def, repoA, 2)
86 listLocalIds(t, def, repoB, 0)
87
88 err = Pull(def, wrapper, repoB, resolvers, "remote", id1)
89 require.NoError(t, err)
90
91 listLocalIds(t, def, repoA, 2)
92 listLocalIds(t, def, repoB, 2)
93}
94
95func listLocalIds(t *testing.T, def Definition, repo repository.RepoData, expectedCount int) {
96 ids, err := ListLocalIds(def, repo)

Callers

nothing calls this directly

Calls 10

makeTestContextRemoteFunction · 0.85
NewFunction · 0.85
newOp1Function · 0.85
newOp2Function · 0.85
listLocalIdsFunction · 0.85
PushFunction · 0.70
FetchFunction · 0.70
PullFunction · 0.70
AppendMethod · 0.65
CommitMethod · 0.65

Tested by

no test coverage detected