From 0e6677fbcbb81e972e5f210e5dd7a2186fb7ba66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 4 Dec 2022 09:59:09 +0100 Subject: [PATCH] core: add result of `utf8_char_size_screen` in /debug unicode --- src/core/wee-debug.c | 7 +++++-- tests/unit/core/test-core-command.cpp | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 32717c67d..279a8171a 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -793,7 +793,8 @@ debug_unicode_char (unsigned int codepoint) ptr_hexa[0] = '\0'; gui_chat_printf (NULL, - "\t \"%s\" (U+%04X, %u, %s): %d %s/%s %d, %d %s/%s %d, %d, %d", + "\t \"%s\" (U+%04X, %u, %s): %d %s/%s %d, %d %s/%s " + "%d, %d, %d, %d", utf8_char, codepoint, codepoint, @@ -806,6 +807,7 @@ debug_unicode_char (unsigned int codepoint) GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT), width, + utf8_char_size_screen (utf8_char), utf8_strlen_screen (utf8_char), gui_chat_strlen_screen (utf8_char)); } @@ -827,7 +829,8 @@ debug_unicode_string (const char *string) "(hex codepoint, codepoint, UTF-8 sequence): " "strlen %s/%s " "utf8_strlen, gui_chat_strlen %s/%s " - "wcwidth, utf8_strlen_screen, gui_chat_strlen_screen:"), + "wcwidth, utf8_char_size_screen, utf8_strlen_screen, " + "gui_chat_strlen_screen:"), GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT), GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), diff --git a/tests/unit/core/test-core-command.cpp b/tests/unit/core/test-core-command.cpp index df1671bf4..75216ebbf 100644 --- a/tests/unit/core/test-core-command.cpp +++ b/tests/unit/core/test-core-command.cpp @@ -215,9 +215,9 @@ 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"); - WEE_CHECK_MSG_CORE(" \"\u00E9\" (U+00E9, 233, 0xC3 0xA9): 2 / 1, 1 / 1, 1, 1"); - WEE_CHECK_MSG_CORE(" \"\u200B\" (U+200B, 8203, 0xE2 0x80 0x8B): 3 / 1, 1 / 0, 0, 0"); + 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"); /* test command "/debug windows" */ /* TODO: write tests */