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

Function TestApplyIgnoreDuplicate

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

Source from the content-addressed store, hash-verified

360}
361
362func TestApplyIgnoreDuplicate(t *testing.T) {
363 st := New()
364 defer close(st.Ops)
365 st.Ops <- Op{1, MustEncodeSet("/x", "a", Clobber)}
366 st.Ops <- Op{1, MustEncodeSet("/x", "b", Clobber)}
367 sync(st, 1)
368 v, rev := st.Get("/x")
369 assert.Equal(t, int64(1), rev)
370 assert.Equal(t, []string{"a"}, v)
371
372 // check that we aren't leaking memory
373 assert.Equal(t, 0, st.todo.Len())
374}
375
376func TestApplyIgnoreDuplicateOutOfOrder(t *testing.T) {
377 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