mirror of https://github.com/tc39/test262.git
Fix groupBy string test keys to be insertion order
This commit is contained in:
parent
e11ef85b1b
commit
0c43c587cc
|
@ -17,6 +17,6 @@ const map = Map.groupBy(string, function (char) {
|
||||||
return char < '🙏' ? 'before' : 'after';
|
return char < '🙏' ? 'before' : 'after';
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.compareArray(Array.from(map.keys()), ['before', 'after']);
|
assert.compareArray(Array.from(map.keys()), ['after', 'before']);
|
||||||
assert.compareArray(map.get('before'), ['💩', '😈']);
|
assert.compareArray(map.get('before'), ['💩', '😈']);
|
||||||
assert.compareArray(map.get('after'), ['🥰', '🙏']);
|
assert.compareArray(map.get('after'), ['🥰', '🙏']);
|
||||||
|
|
|
@ -17,6 +17,6 @@ const obj = Object.groupBy(string, function (char) {
|
||||||
return char < '🙏' ? 'before' : 'after';
|
return char < '🙏' ? 'before' : 'after';
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.compareArray(Object.keys(obj), ['before', 'after']);
|
assert.compareArray(Object.keys(obj), ['after', 'before']);
|
||||||
assert.compareArray(obj.before, ['💩', '😈']);
|
assert.compareArray(obj.before, ['💩', '😈']);
|
||||||
assert.compareArray(obj.after, ['🥰', '🙏']);
|
assert.compareArray(obj.after, ['🥰', '🙏']);
|
||||||
|
|
Loading…
Reference in New Issue