MCPcopy Index your code
hub / github.com/docker/docker-agent / TestMap_StoreOverwrites

Function TestMap_StoreOverwrites

pkg/concurrent/map_test.go:30–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestMap_StoreOverwrites(t *testing.T) {
31 t.Parallel()
32 m := NewMap[string, int]()
33 m.Store("k", 1)
34 m.Store("k", 2)
35
36 val, ok := m.Load("k")
37 assert.True(t, ok)
38 assert.Equal(t, 2, val)
39 assert.Equal(t, 1, m.Length())
40}
41
42func TestMap_Delete(t *testing.T) {
43 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewMapFunction · 0.85
LoadMethod · 0.80
StoreMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected