summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-command.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-12-04 20:03:21 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-12-10 16:05:14 +0100
commitf1cfd6f73f0f5cc16b9b919d64406a35aa81c7cf (patch)
tree96a6dfbea3772e65aeec1344b2cb4c7061c916ef /tests/unit/core/test-core-command.cpp
parentd18f68e497c4244404ff8f4f50de82717b178e09 (diff)
downloadweechat-f1cfd6f73f0f5cc16b9b919d64406a35aa81c7cf.zip
core: do not display non printable chars, fix function utf8_char_size_screen
Now the function utf8_char_size_screen can return -1 when the char is not printable. It has a specific behavior for some chars: - U+0009: value of option weechat.look.tab_width - U+0001 to U+001F (except U+0009): 1 - U+00AD (soft hyphen): -1 - U+200B (zero width space): -1
Diffstat (limited to 'tests/unit/core/test-core-command.cpp')
-rw-r--r--tests/unit/core/test-core-command.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unit/core/test-core-command.cpp b/tests/unit/core/test-core-command.cpp
index 75216ebbf..7293b9f50 100644
--- a/tests/unit/core/test-core-command.cpp
+++ b/tests/unit/core/test-core-command.cpp
@@ -151,9 +151,8 @@ TEST(CoreCommand, Debug)
{
const char *command_debug_unicode =
"/debug unicode "
- "\u00AD" /* soft hyphen */
"\u00E9" /* é */
- "\u200B" /* zero width space */
+ "\u26C4" /* ⛄ (snowman without snow) */
"";
/* test command "/debug list" */
@@ -215,9 +214,8 @@ TEST(CoreCommand, Debug)
/* test command "/debug unicode" */
WEE_CMD_CORE(command_debug_unicode);
- WEE_CHECK_MSG_CORE(" \"\u00AD\" (U+00AD, 173, 0xC2 0xAD): 2 / 1, 1 / 1, 1, 1, 1");
WEE_CHECK_MSG_CORE(" \"\u00E9\" (U+00E9, 233, 0xC3 0xA9): 2 / 1, 1 / 1, 1, 1, 1");
- WEE_CHECK_MSG_CORE(" \"\u200B\" (U+200B, 8203, 0xE2 0x80 0x8B): 3 / 1, 1 / 0, 0, 0, 0");
+ WEE_CHECK_MSG_CORE(" \"\u26C4\" (U+26C4, 9924, 0xE2 0x9B 0x84): 3 / 1, 1 / 2, 2, 2, 2");
/* test command "/debug windows" */
/* TODO: write tests */