(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestMapCompareAndSwap(t *testing.T) { |
| 110 | var m Map[int, string] |
| 111 | m.Store(1, "one") |
| 112 | |
| 113 | ok := m.CompareAndSwap(1, "one", "uno") |
| 114 | if !ok { |
| 115 | t.Errorf("CompareAndSwap(1, 'one', 'uno') = false; want true") |
| 116 | } |
| 117 | |
| 118 | v, _ := m.Load(1) |
| 119 | if v != "uno" { |
| 120 | t.Errorf("Load(1) after CompareAndSwap = %v; want 'uno'", v) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | func TestMapCompareAndDelete(t *testing.T) { |
| 125 | var m Map[int, string] |
nothing calls this directly
no test coverage detected