mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +00:00
LibJS/Tests: Test iteration order of Map.prototype.entries()
This commit is contained in:
parent
455b94af7f
commit
419c21c66f
1 changed files with 3 additions and 10 deletions
|
@ -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 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue