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

core: add repeat of string in evaluation of expressions with "repeat:count,string" (closes #958)

This commit is contained in:
Sébastien Helleu
2018-10-09 21:12:02 +02:00
parent 82697714e1
commit 8da3458f4c
30 changed files with 515 additions and 337 deletions
+8
View File
@@ -351,6 +351,14 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("!dlrow ,olleH", "${rev:Hello, world!}");
WEE_CHECK_EVAL("界世はちにんこ", "${rev:こんにちは世界}");
/* test repeat of string */
WEE_CHECK_EVAL("", "${repeat:-1,x}");
WEE_CHECK_EVAL("", "${repeat:0,x}");
WEE_CHECK_EVAL("x", "${repeat:1,x}");
WEE_CHECK_EVAL("xxxxx", "${repeat:5,x}");
WEE_CHECK_EVAL("cbacbacba", "${repeat:3,${rev:abc}}");
WEE_CHECK_EVAL("cbacba", "${repeat:${rev:20},${rev:abc}}");
/* test color */
WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}");
WEE_CHECK_EVAL(gui_color_get_custom ("*214"), "${color:*214}");