diff options
author | Linus Groh <mail@linusgroh.de> | 2021-08-13 23:53:11 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-13 23:54:08 +0100 |
commit | 419c21c66f38ce8136b6c13563a069743977815d (patch) | |
tree | db738b49f4a1c606feccc61f9c5c24c47f9822fd /Userland | |
parent | 455b94af7ffdde38798fb6dad79e8a6ff04e386b (diff) | |
download | serenity-419c21c66f38ce8136b6c13563a069743977815d.zip |
LibJS/Tests: Test iteration order of Map.prototype.entries()
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.entries.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.entries.js b/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.entries.js index b811fc1b9b..4d719a1fce 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.entries.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.entries.js @@ -10,16 +10,9 @@ test("basic functionality", () => { ]; const a = new Map(original); const it = a.entries(); - // FIXME: This test should be rewritten once we have proper iteration order - const first = it.next(); - expect(first.done).toBeFalse(); - expect(a.has(first.value[0])).toBeTrue(); - const second = it.next(); - expect(second.done).toBeFalse(); - expect(a.has(second.value[0])).toBeTrue(); - const third = it.next(); - expect(third.done).toBeFalse(); - expect(a.has(third.value[0])).toBeTrue(); + expect(it.next()).toEqual({ value: ["a", 0], done: false }); + expect(it.next()).toEqual({ value: ["b", 1], done: false }); + expect(it.next()).toEqual({ value: ["c", 2], done: false }); expect(it.next()).toEqual({ value: undefined, done: true }); expect(it.next()).toEqual({ value: undefined, done: true }); expect(it.next()).toEqual({ value: undefined, done: true }); |