MCPcopy
hub / github.com/nats-io/nats.go / TestMapDelete

Function TestMapDelete

internal/syncx/map_test.go:45–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestMapDelete(t *testing.T) {
46 var m Map[int, string]
47 m.Store(1, "one")
48 m.Delete(1)
49
50 v, ok := m.Load(1)
51 if ok || v != "" {
52 t.Errorf("Load(1) after Delete(1) = %v, %v; want '', false", v, ok)
53 }
54}
55
56func TestMapRange(t *testing.T) {
57 var m Map[int, string]

Callers

nothing calls this directly

Calls 4

StoreMethod · 0.80
LoadMethod · 0.80
ErrorfMethod · 0.80
DeleteMethod · 0.65

Tested by

no test coverage detected