summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-eval.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-09-21 07:56:21 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-09-21 07:56:21 +0200
commitdcfc4e8ed59e015d0d83944bdadf39e8b83298ea (patch)
tree124e81991dc639ef7a208c22653f89e29adb4eb6 /tests/unit/core/test-core-eval.cpp
parent1919f23c2d67dcf38765a06943e66f89d5873a62 (diff)
downloadweechat-dcfc4e8ed59e015d0d83944bdadf39e8b83298ea.zip
core: add "length:xxx" and "lengthscr:xxx" in evaluation of expressions
Diffstat (limited to 'tests/unit/core/test-core-eval.cpp')
-rw-r--r--tests/unit/core/test-core-eval.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp
index 4a208c1d0..d2a4da21e 100644
--- a/tests/unit/core/test-core-eval.cpp
+++ b/tests/unit/core/test-core-eval.cpp
@@ -363,6 +363,15 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("cbacbacba", "${repeat:3,${rev:abc}}");
WEE_CHECK_EVAL("cbacba", "${repeat:${rev:20},${rev:abc}}");
+ /* test length of string */
+ WEE_CHECK_EVAL("0", "${length:}");
+ WEE_CHECK_EVAL("4", "${length:test}");
+ WEE_CHECK_EVAL("7", "${length:こんにちは世界}");
+
+ WEE_CHECK_EVAL("0", "${lengthscr:}");
+ WEE_CHECK_EVAL("4", "${lengthscr:test}");
+ WEE_CHECK_EVAL("14", "${lengthscr:こんにちは世界}");
+
/* test color */
WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}");
WEE_CHECK_EVAL(gui_color_get_custom ("*214"), "${color:*214}");