Index: test/mjsunit/harmony/symbols.js |
diff --git a/test/mjsunit/harmony/symbols.js b/test/mjsunit/harmony/symbols.js |
index b35d950981ba1f119cbc71a88a8eb21eca9f9a38..b0aebd345ba34a298be3db07d837cf0ac4b1d4b4 100644 |
--- a/test/mjsunit/harmony/symbols.js |
+++ b/test/mjsunit/harmony/symbols.js |
@@ -114,17 +114,33 @@ function TestSet() { |
TestSet() |
-function TestMap() { |
+function TestCollections() { |
+ var set = new Set |
var map = new Map |
+ var weakmap = new WeakMap |
for (var i in symbols) { |
+ set.add(symbols[i]) |
map.set(symbols[i], i) |
+ weakmap.set(symbols[i], i) |
} |
+ assertEquals(symbols.length, set.size) |
+ assertEquals(symbols.length, map.size) |
for (var i in symbols) { |
+ assertTrue(set.has(symbols[i])) |
assertTrue(map.has(symbols[i])) |
+ assertTrue(weakmap.has(symbols[i])) |
assertEquals(i, map.get(symbols[i])) |
+ assertEquals(i, weakmap.get(symbols[i])) |
} |
+ for (var i in symbols) { |
+ assertTrue(set.delete(symbols[i])) |
+ assertTrue(map.delete(symbols[i])) |
+ assertTrue(weakmap.delete(symbols[i])) |
+ } |
+ assertEquals(0, set.size) |
+ assertEquals(0, map.size) |
} |
-TestMap() |
+TestCollections() |