diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-02-08 10:29:07 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-02-08 10:29:07 +0100 |
commit | 39f2591cf5fa20b9369f15368d314b1410188ac8 (patch) | |
tree | 792d793f2533a69cad41f10a47e3786752ffce8a /tests/unit | |
parent | 276998975146bceb3e105f0a2924744d10d862de (diff) | |
download | weechat-39f2591cf5fa20b9369f15368d314b1410188ac8.zip |
tests: add tests on ANSI default text/background colors
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-color.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/plugins/irc/test-irc-color.cpp b/tests/unit/plugins/irc/test-irc-color.cpp index 9fc182fa6..e0d6a267f 100644 --- a/tests/unit/plugins/irc/test-irc-color.cpp +++ b/tests/unit/plugins/irc/test-irc-color.cpp @@ -110,6 +110,10 @@ extern "C" "test_\x1B[38;2;255;0;255m\x1B[48;2;0;0;128mcolor13/02" #define STRING_ANSI_FG_TERM_IRC_13_BG_TERM_IRC_02 \ "test_\x1B[38;5;13m\x1B[48;5;4mcolor13/02" +#define STRING_ANSI_DEFAULT_FG \ + "test_\x1B[39mdefault_fg" +#define STRING_ANSI_DEFAULT_BG \ + "test_\x1B[49mdefault_bg" #define WEE_CHECK_DECODE(__result, __string, __keep_colors) \ decoded = irc_color_decode (__string, __keep_colors); \ @@ -492,4 +496,18 @@ TEST(IrcColor, DecodeAnsi) IRC_COLOR_COLOR_STR); WEE_CHECK_DECODE_ANSI(string, STRING_ANSI_FG_TERM_IRC_13_BG_TERM_IRC_02, 1); + + /* default text color */ + WEE_CHECK_DECODE_ANSI("test_default_fg", STRING_ANSI_DEFAULT_FG, 0); + snprintf (string, sizeof (string), + "test_%s15default_fg", + IRC_COLOR_COLOR_STR); + WEE_CHECK_DECODE_ANSI(string, STRING_ANSI_DEFAULT_FG, 1); + + /* default background color */ + WEE_CHECK_DECODE_ANSI("test_default_bg", STRING_ANSI_DEFAULT_BG, 0); + snprintf (string, sizeof (string), + "test_%s,01default_bg", + IRC_COLOR_COLOR_STR); + WEE_CHECK_DECODE_ANSI(string, STRING_ANSI_DEFAULT_BG, 1); } |