MCPcopy
hub / github.com/ha/doozerd / TestSnap

Function TestSnap

src/pkg/store/store_test.go:200–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

198}
199
200func TestSnap(t *testing.T) {
201 st := New()
202 defer close(st.Ops)
203 mut := MustEncodeSet("/x", "a", Clobber)
204 st.Ops <- Op{1, mut}
205 <-st.Seqns // ensure it has been applied before grabbing the snapshot
206
207 _, snap := st.Snap()
208
209 root, ok := snap.(node)
210 assert.Equal(t, true, ok)
211
212 exp, _ := emptyDir.apply(1, mut)
213 assert.Equal(t, exp, root)
214}
215
216func TestApplyInOrder(t *testing.T) {
217 st := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
MustEncodeSetFunction · 0.85
SnapMethod · 0.80
applyMethod · 0.80

Tested by

no test coverage detected