1
0
forked from Mirror/wren
Files
wren/test/core/map/reuse_tombstone.wren
Bob Nystrom 4e94195f26 Properly handle tombstones when inserting items into a map.
Previously, you could get into a state where a key was present in the
map, but after a tombstone in the probe sequence. If they key was added
again, it stopped at the first tombstone and added it there, resulting
in the key being in the map multiple times.

Fix #373.
2016-06-27 07:14:52 -07:00

10 lines
174 B
Plaintext

// Regression test for #373.
var map = {}
map[2] = "two"
map[0] = "zero"
map.remove(2)
map[0] = "zero again"
map.remove(0)
System.print(map.containsKey(0)) // expect: false