Add more grapheme-cluster examples to test and demo

This commit is contained in:
Per Bothner
2023-08-17 13:23:10 -07:00
parent e3d3cdb9d2
commit f1bc95622d
2 changed files with 21 additions and 20 deletions
@@ -49,14 +49,20 @@ describe('UnicodeGraphemesAddon', () => {
'baby with emoji modifier fitzpatrick type-6; baby');
assert.equal(await evalWidth('\u{1F469}\u200d\u{1f469}\u200d\u{1f466}'), 2,
'woman+zwj+woman+zwj+boy');
assert.equal(await evalWidth('=\u{1F3CB}\u{FE0F}=\u{F3CB}\u{1F3FE}\u200D\u2640='), 7,
'person lifting weights (plain, emoji); woman lighting weights, medium dark');
assert.equal(await evalWidth('\u{1F469}\u{1F469}\u{200D}\u{1F393}\u{1F468}\u{1F3FF}\u{200D}\u{1F393}'), 6,
'woman; woman student; man student dark');
assert.equal(await evalWidth('\u{1f1f3}\u{1f1f4}/'), 3,
'regional indicator symbol letters N and O, cluster');
assert.equal(await evalWidth('\u{1f1f3}/\u{1f1f4}'), 3,
'regional indicator symbol letters N and O, separated');
assert.equal(await evalWidth('\u0061\u0301'), 1,
'letter a with acute accent');
assert.equal(await evalWidth('{\u1100\u1161\u11a8}'), 4,
assert.equal(await evalWidth('{\u1100\u1161\u11a8\u1100\u1161}'), 6,
'Korean Jamo');
assert.equal(await evalWidth('\uAC00=\uD685='), 6,
'Hangul syllables (pre-composed)');
assert.equal(await evalWidth('(\u26b0\ufe0e)'), 3,
'coffin with text presentation');
assert.equal(await evalWidth('(\u26b0\ufe0f)'), 4,