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

Function TestApplyIgnoreDuplicateOutOfOrder

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

Source from the content-addressed store, hash-verified

374}
375
376func TestApplyIgnoreDuplicateOutOfOrder(t *testing.T) {
377 st := New()
378 defer close(st.Ops)
379 st.Ops <- Op{1, MustEncodeSet("/x", "a", Clobber)}
380 st.Ops <- Op{2, MustEncodeSet("/x", "b", Clobber)}
381 st.Ops <- Op{1, MustEncodeSet("/x", "c", Clobber)}
382 sync(st, 1)
383 v, rev := st.Get("/x")
384 assert.Equal(t, int64(2), rev)
385 assert.Equal(t, []string{"b"}, v)
386
387 // check that we aren't leaking memory
388 assert.Equal(t, 0, st.todo.Len())
389}
390
391func TestGetWithDir(t *testing.T) {
392 st := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
MustEncodeSetFunction · 0.85
syncFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected