mirror of https://github.com/tc39/test262.git
Use emoji strings
This commit is contained in:
parent
065ccc121e
commit
b73f7d662d
|
@ -11,12 +11,12 @@ includes: [compareArray.js]
|
|||
features: [array-grouping, Map]
|
||||
---*/
|
||||
|
||||
const string = 'abcd';
|
||||
const string = '🥰💩🙏😈';
|
||||
|
||||
const map = Map.groupBy(string, function (char) {
|
||||
return char < 'c' ? 'before' : 'after';
|
||||
return char < '🙏' ? 'before' : 'after';
|
||||
});
|
||||
|
||||
assert.compareArray(Array.from(map.keys()), ['before', 'after']);
|
||||
assert.compareArray(map.get('before'), ['a', 'b']);
|
||||
assert.compareArray(map.get('after'), ['c', 'd']);
|
||||
assert.compareArray(map.get('before'), ['💩', '😈']);
|
||||
assert.compareArray(map.get('after'), ['🥰', '🙏']);
|
||||
|
|
|
@ -11,12 +11,12 @@ includes: [compareArray.js]
|
|||
features: [array-grouping]
|
||||
---*/
|
||||
|
||||
const string = 'abcd';
|
||||
const string = '🥰💩🙏😈';
|
||||
|
||||
const obj = Object.groupBy(string, function (char) {
|
||||
return char < 'c' ? 'before' : 'after';
|
||||
return char < '🙏' ? 'before' : 'after';
|
||||
});
|
||||
|
||||
assert.compareArray(Object.keys(obj), ['before', 'after']);
|
||||
assert.compareArray(obj.before, ['a', 'b']);
|
||||
assert.compareArray(obj.after, ['c', 'd']);
|
||||
assert.compareArray(obj.before, ['💩', '😈']);
|
||||
assert.compareArray(obj.after, ['🥰', '🙏']);
|
||||
|
|
Loading…
Reference in New Issue