summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-01-27 21:28:59 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-01-27 23:04:22 +0100
commit1914ceb74ff2494a30638e70a4f3bbf0c237cde4 (patch)
tree805cebcf8add1682e4fded2666f7616c47c04d38 /tests
parent34bb43379a64ff8f875efcfa5b8335fae9ae7960 (diff)
downloadweechat-1914ceb74ff2494a30638e70a4f3bbf0c237cde4.zip
tests: add eval tests with invalid values for "cut:" and "cutscr:"
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/test-core-eval.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp
index f1cbbd7fb..d10fa8490 100644
--- a/tests/unit/core/test-core-eval.cpp
+++ b/tests/unit/core/test-core-eval.cpp
@@ -281,6 +281,14 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("********", "${hide:*,password}");
WEE_CHECK_EVAL("\u2603\u2603\u2603", "${hide:${esc:\u2603},abc}");
+ /* test cut of chars (invalid values) */
+ WEE_CHECK_EVAL("", "${cut:}");
+ WEE_CHECK_EVAL("", "${cut:0,}");
+ WEE_CHECK_EVAL("", "${cut:a,,}");
+ WEE_CHECK_EVAL("", "${cutscr:}");
+ WEE_CHECK_EVAL("", "${cutscr:0,}");
+ WEE_CHECK_EVAL("", "${cutscr:a,,}");
+
/* test cut of chars */
WEE_CHECK_EVAL("", "${cut:0,,}");
WEE_CHECK_EVAL("", "${cutscr:0,,}");