(t *testing.T)
| 24 | } |
| 25 | |
| 26 | func 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 | |
| 39 | func TestSyncMap_Delete(t *testing.T) { |
| 40 | sm := MakeSyncMap[int]() |