1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

core: add support of modifiers in evaluation of expressions with "modifier:name,data,string" (issue #60)

This commit is contained in:
Sébastien Helleu
2019-10-06 09:13:35 +02:00
parent 1a0ba4a9dc
commit 88aa82d672
27 changed files with 353 additions and 254 deletions
+14
View File
@@ -392,6 +392,20 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL(str_value, "${color:irc.color.message_join}-test-");
WEE_CHECK_EVAL("test", "${option.not.found}test");
/* test modifier */
WEE_CHECK_EVAL("test_string", "test_${modifier:xxx,data,string}");
WEE_CHECK_EVAL("test_no_color",
"${modifier:color_decode_ansi,0,test_\x1B[92mno_color}");
snprintf (str_value, sizeof (str_value),
"test_%slightgreen",
gui_color_get_custom ("lightgreen"));
WEE_CHECK_EVAL(str_value,
"${modifier:color_decode_ansi,1,test_\x1B[92mlightgreen}");
snprintf (str_value, sizeof (str_value),
"${modifier:color_encode_ansi,,test_%slightgreen}",
gui_color_get_custom ("lightgreen"));
WEE_CHECK_EVAL("test_\x1B[92mlightgreen", str_value);
/* test info */
WEE_CHECK_EVAL(version_get_version (), "${info:version}");