From 5d8a0a6ce5dbb12963323f97220767fcf7c08b5c Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 20 Mar 2025 11:24:13 +0100 Subject: Add initial wide-character support Adds support for the emoticon, hiragana, katakana and CJK unicode blocks. --- tests/runewidth.ha | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/runewidth.ha (limited to 'tests') diff --git a/tests/runewidth.ha b/tests/runewidth.ha new file mode 100644 index 0000000..5e570a5 --- /dev/null +++ b/tests/runewidth.ha @@ -0,0 +1,9 @@ +use tui; + +@test +fn runewidth() void = { + assert(tui::runewidth('f') == 1); + assert(tui::runewidth('ๅคง') == 2); + assert(tui::runewidth('ใ') == 2); + assert(tui::runewidth('๐Ÿ˜€') == 2); +}; -- cgit v1.2.3 From 6e8a2af6bd47fd05e6b22937c5da7397549e7cbb Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 20 Mar 2025 11:30:58 +0100 Subject: Add tests for width and rm cmd/runewidth.ha --- tests/strwidth.ha | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/strwidth.ha (limited to 'tests') diff --git a/tests/strwidth.ha b/tests/strwidth.ha new file mode 100644 index 0000000..e3863d6 --- /dev/null +++ b/tests/strwidth.ha @@ -0,0 +1,6 @@ +use tui; + +@test +fn strwidth() void = { + assert(tui::strwidth("ๅคงใ๐Ÿ˜€f") == 7); +}; -- cgit v1.2.3