(t *testing.T)
| 1254 | } |
| 1255 | |
| 1256 | func TestExist(t *testing.T) { |
| 1257 | hash := createMap(t, Hash, 10) |
| 1258 | |
| 1259 | if err := hash.Put("test", uint32(21)); err != nil { |
| 1260 | t.Errorf("Failed to put key/value pair into hash: %v", err) |
| 1261 | } |
| 1262 | |
| 1263 | if err := hash.Update("test", uint32(42), UpdateNoExist); !errors.Is(err, ErrKeyExist) { |
| 1264 | t.Error("Updating existing key doesn't return ErrKeyExist") |
| 1265 | } |
| 1266 | } |
| 1267 | |
| 1268 | func TestIterateMapInMap(t *testing.T) { |
| 1269 | const idx = uint32(1) |