From 419c21c66f38ce8136b6c13563a069743977815d Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 13 Aug 2021 23:53:11 +0100 Subject: [PATCH] LibJS/Tests: Test iteration order of Map.prototype.entries() --- .../Tests/builtins/Map/Map.prototype.entries.js | 13 +++---------- 1 file 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 });