summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-eval.cpp
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-11-14 09:28:46 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-11-14 09:28:46 +0100
commitb626df72fb7cdc9d9f23a0e5a81209faace87c0f (patch)
treedd681ba32d35ffb8a5ad7abb58ddab0ced624c27 /tests/unit/core/test-core-eval.cpp
parenteb90a73fe811e2de0e0646abf10242e639a7b1a1 (diff)
downloadweechat-b626df72fb7cdc9d9f23a0e5a81209faace87c0f.zip
core: add evaluation of conditions in evaluation of expressions with "eval_cond:" (closes #1582)
Diffstat (limited to 'tests/unit/core/test-core-eval.cpp')
-rw-r--r--tests/unit/core/test-core-eval.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp
index a5821ab9a..5e5f9762b 100644
--- a/tests/unit/core/test-core-eval.cpp
+++ b/tests/unit/core/test-core-eval.cpp
@@ -384,6 +384,11 @@ TEST(CoreEval, EvalExpression)
/* test eval of substring */
WEE_CHECK_EVAL("\t", "${eval:${\\t}}");
+ /* test eval of condition */
+ WEE_CHECK_EVAL("0", "${eval_cond:}");
+ WEE_CHECK_EVAL("0", "${eval_cond:${buffer.number} == 2}");
+ WEE_CHECK_EVAL("1", "${eval_cond:${buffer.number} == 1}");
+
/* test value from extra_vars */
WEE_CHECK_EVAL("value", "${test}");