summaryrefslogtreecommitdiff
path: root/tests/unit/gui/test-gui-color.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-11 13:51:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-11 14:05:52 +0200
commit1a0b9427e0b27bd9f1a63a4f4eda24e1f3c93a48 (patch)
treeed6e8dd1bd8b514a06838163b70b2b78aa6b11f5 /tests/unit/gui/test-gui-color.cpp
parent32b01a606c3ecf64b05b139c52fedc52cb00c7ab (diff)
downloadweechat-1a0b9427e0b27bd9f1a63a4f4eda24e1f3c93a48.zip
core: fix conversion of WeeChat bar colors to ANSI colors
Diffstat (limited to 'tests/unit/gui/test-gui-color.cpp')
-rw-r--r--tests/unit/gui/test-gui-color.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/gui/test-gui-color.cpp b/tests/unit/gui/test-gui-color.cpp
index d2f618429..15fbf0f17 100644
--- a/tests/unit/gui/test-gui-color.cpp
+++ b/tests/unit/gui/test-gui-color.cpp
@@ -797,6 +797,24 @@ TEST(GuiColor, EncodeAnsi)
gui_color_get_custom ("default"));
WEE_CHECK_ENCODE_ANSI("test_" "\x1B[39m" "default", string);
+ /* text color: bar foreground -> ANSI: 39 (default fg color) */
+ snprintf (string, sizeof (string),
+ "test_" "%s" "bar_fg",
+ gui_color_get_custom ("bar_fg"));
+ WEE_CHECK_ENCODE_ANSI("test_" "\x1B[39m" "bar_fg", string);
+
+ /* text color: bar background -> ANSI: 49 (default bg color) */
+ snprintf (string, sizeof (string),
+ "test_" "%s" "bar_bg",
+ gui_color_get_custom ("bar_bg"));
+ WEE_CHECK_ENCODE_ANSI("test_" "\x1B[49m" "bar_bg", string);
+
+ /* text color: bar delimiter -> color in option weechat.color.chat_delimiters */
+ snprintf (string, sizeof (string),
+ "test_" "%s" "bar_delim",
+ gui_color_get_custom ("bar_delim"));
+ WEE_CHECK_ENCODE_ANSI("test_" "\x1B[48;5;22m" "bar_delim", string);
+
/* text color */
snprintf (string, sizeof (string),
"test_" "%s" "blue",