mirror of
https://github.com/TextPlace/CoreTextPlace.git
synced 2025-08-18 14:12:40 +00:00
feat: support any unicode grapheme clusters.
This commit is contained in:
parent
8940f26f17
commit
4dd8121ebb
4 changed files with 14 additions and 17 deletions
|
@ -26,14 +26,12 @@ Deno.test("getCharacterWidth CJK", () => {
|
|||
assertEquals(getCharacterWidth("グ"), 2);
|
||||
assertEquals(getCharacterWidth("ソ"), 2);
|
||||
|
||||
assertThrows(() => getCharacterWidth("?"));
|
||||
assertThrows(() => getCharacterWidth("!"));
|
||||
assertEquals(getCharacterWidth("?"), 2);
|
||||
assertEquals(getCharacterWidth("!"), 2);
|
||||
assertThrows(() => getCharacterWidth("你好"));
|
||||
assertThrows(() => getCharacterWidth("ヨスガノ"));
|
||||
});
|
||||
|
||||
Deno.test("getCharacterWidth previously faulty cases", () => {
|
||||
assertEquals(getCharacterWidth("𤲶"), 2);
|
||||
|
||||
assertThrows(() => getCharacterWidth("𤲶"[0]));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue