change to v11, expose unicodeVersion, fix linkifier

This commit is contained in:
Jörg Breitbart
2019-11-15 18:08:17 +01:00
parent 25bbde2be2
commit aca6d24e96
10 changed files with 48 additions and 36 deletions
+8 -1
View File
@@ -4,7 +4,7 @@
*/
import { assert } from 'chai';
import { wcwidthV6 } from 'common/CharWidth';
import { wcwidthV6, getStringCellWidthV6, getStringCellWidthV11 } from 'common/CharWidth';
it('wcwidth should match all values from the old implementation', function(): void {
// old implementation
@@ -180,3 +180,10 @@ it('wcwidth should match all values from the old implementation', function(): vo
assert.equal(wcwidthV6(i), wcwidthOld(i), `mismatch for i: ${i}`);
}
});
it('wcwidth V6 vs. V11', () => {
const widthV6 = getStringCellWidthV6('🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣');
assert.equal(widthV6, 10);
const widthV10 = getStringCellWidthV11('🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣');
assert.equal(widthV10, 20);
});