summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-12-30 21:50:18 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-12-30 21:50:18 +0100
commit05839983d45af29a383a8e702753eb9617b4e260 (patch)
tree59f0994232c4a5e5dc01e7f33cedf1087b8de00c /tests/unit
parent6c59b0830c58d7889cf4be0b3b5b277715747e9d (diff)
downloadweechat-05839983d45af29a383a8e702753eb9617b4e260.zip
core: fix color when the delimiter is not followed by a background color (closes #1867)
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/gui/test-gui-color.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/gui/test-gui-color.cpp b/tests/unit/gui/test-gui-color.cpp
index ecf3f0951..2505c2f92 100644
--- a/tests/unit/gui/test-gui-color.cpp
+++ b/tests/unit/gui/test-gui-color.cpp
@@ -192,6 +192,10 @@ TEST(GuiColor, GetCustom)
GUI_COLOR_BAR_BG_CHAR);
STRCMP_EQUAL(string, gui_color_get_custom ("bar_bg"));
+ /* only delimiter (no-op) */
+ STRCMP_EQUAL("", gui_color_get_custom (","));
+ STRCMP_EQUAL("", gui_color_get_custom (":"));
+
/* fg color */
snprintf (string, sizeof (string),
"%c%c09",
@@ -199,6 +203,14 @@ TEST(GuiColor, GetCustom)
GUI_COLOR_FG_CHAR);
STRCMP_EQUAL(string, gui_color_get_custom ("blue"));
+ /* fg color, delimiter and no bg color */
+ snprintf (string, sizeof (string),
+ "%c%c09",
+ GUI_COLOR_COLOR_CHAR,
+ GUI_COLOR_FG_CHAR);
+ STRCMP_EQUAL(string, gui_color_get_custom ("blue,"));
+ STRCMP_EQUAL(string, gui_color_get_custom ("blue:"));
+
/* bg color */
snprintf (string, sizeof (string),
"%c%c09",