From 4032ea52454b84631b60b7f25177a6c6a9d0332e Mon Sep 17 00:00:00 2001 From: Hyeseong Kim Date: Sun, 24 Nov 2024 11:37:19 +0900 Subject: [PATCH] fix test --- README.md | 2 +- test/grapheme.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8cb1b71..a3f6ea8 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ countGrapheme('a̐éö̲'); > [!NOTE] > `countGrapheme()` is a small wrapper around `graphemeSegments()`. > -> If you call it more than once at a time, consider memoization or use `graphemeSegments()` or `splitSegments()` once instead. +> If you need it more than once at a time, consider memoization or use `graphemeSegments()` or `splitSegments()` once instead. #### Example: Build an advanced grapheme matcher diff --git a/test/grapheme.js b/test/grapheme.js index 89c480e..860185b 100644 --- a/test/grapheme.js +++ b/test/grapheme.js @@ -108,53 +108,53 @@ test('countGrapheme', async t => { test('splitGrapheme', async t => { await t.test('latin', () => { assert.deepEqual( - splitGraphemes('abcd'), + [...splitGraphemes('abcd')], ['a', 'b', 'c', 'd'], ); }); await t.test('flags', () => { assert.deepEqual( - splitGraphemes('🇷🇸🇮🇴'), + [...splitGraphemes('🇷🇸🇮🇴')], ['🇷🇸', '🇮🇴'], ); }); await t.test('emoji', () => { assert.deepEqual( - splitGraphemes('👻👩‍👩‍👦‍👦'), + [...splitGraphemes('👻👩‍👩‍👦‍👦')], ['👻', '👩‍👩‍👦‍👦'], ); assert.deepEqual( - splitGraphemes('🌷🎁💩😜👍🏳️‍🌈'), + [...splitGraphemes('🌷🎁💩😜👍🏳️‍🌈')], ['🌷', '🎁', '💩', '😜', '👍', '🏳️‍🌈'], ); }); await t.test('diacritics as combining marks', () => { assert.deepEqual( - splitGraphemes('Ĺo͂řȩm̅'), + [...splitGraphemes('Ĺo͂řȩm̅')], ['Ĺ', 'o͂', 'ř', 'ȩ', 'm̅'], ); }); await t.test('Jamo', () => { assert.deepEqual( - splitGraphemes('가갉'), + [...splitGraphemes('가갉')], ['가', '갉'], ); }); await t.test('Hindi', () => { assert.deepEqual( - splitGraphemes('अनुच्छेद'), + [...splitGraphemes('अनुच्छेद')], ['अ', 'नु', 'च्छे', 'द'], ); }); await t.test('demonic', () => { assert.deepEqual( - splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞'), + [...splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞')], ['Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍', 'A̴̵̜̰͔ͫ͗͢', 'L̠ͨͧͩ͘', 'G̴̻͈͍͔̹̑͗̎̅͛́', 'Ǫ̵̹̻̝̳͂̌̌͘', '!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞'], ); });