MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / TestSyncMap_GetEx

Function TestSyncMap_GetEx

pkg/util/ds/syncmap_test.go:26–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestSyncMap_GetEx(t *testing.T) {
27 sm := MakeSyncMap[int]()
28 sm.Set("key1", 1)
29 value, ok := sm.GetEx("key1")
30 if !ok || value != 1 {
31 t.Errorf("expected 1, got %d", value)
32 }
33 value, ok = sm.GetEx("key2")
34 if ok || value != 0 {
35 t.Errorf("expected 0, got %d", value)
36 }
37}
38
39func TestSyncMap_Delete(t *testing.T) {
40 sm := MakeSyncMap[int]()

Callers

nothing calls this directly

Calls 2

GetExMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected