From 05839983d45af29a383a8e702753eb9617b4e260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 30 Dec 2022 21:50:18 +0100 Subject: core: fix color when the delimiter is not followed by a background color (closes #1867) --- tests/unit/gui/test-gui-color.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/unit') 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", -- cgit v1.2.3