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

Function TestApplyOutOfOrder

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

Source from the content-addressed store, hash-verified

348}
349
350func TestApplyOutOfOrder(t *testing.T) {
351 st := New()
352 defer close(st.Ops)
353 st.Ops <- Op{2, MustEncodeSet("/x", "b", Clobber)}
354 st.Ops <- Op{1, MustEncodeSet("/x", "a", Clobber)}
355
356 sync(st, 2)
357 v, rev := st.Get("/x")
358 assert.Equal(t, int64(2), rev)
359 assert.Equal(t, []string{"b"}, v)
360}
361
362func TestApplyIgnoreDuplicate(t *testing.T) {
363 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