diff options
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/core/test-eval.cpp | 36 | ||||
-rw-r--r-- | tests/unit/core/test-string.cpp | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/unit/core/test-eval.cpp b/tests/unit/core/test-eval.cpp index e0bd236b7..14f60f80b 100644 --- a/tests/unit/core/test-eval.cpp +++ b/tests/unit/core/test-eval.cpp @@ -237,6 +237,42 @@ TEST(Eval, EvalExpression) WEE_CHECK_EVAL("te+", "${cut:2,+,test}"); WEE_CHECK_EVAL("te+", "${cutscr:2,+,test}"); + WEE_CHECK_EVAL("tes", "${cut:3,,test}"); + WEE_CHECK_EVAL("tes", "${cutscr:3,,test}"); + WEE_CHECK_EVAL("tes", "${cut:+3,,test}"); + WEE_CHECK_EVAL("tes", "${cutscr:+3,,test}"); + + WEE_CHECK_EVAL("tes+", "${cut:3,+,test}"); + WEE_CHECK_EVAL("tes+", "${cutscr:3,+,test}"); + WEE_CHECK_EVAL("tes++", "${cut:3,++,test}"); + WEE_CHECK_EVAL("tes++", "${cutscr:3,++,test}"); + WEE_CHECK_EVAL("tes+++", "${cut:3,+++,test}"); + WEE_CHECK_EVAL("tes+++", "${cutscr:3,+++,test}"); + WEE_CHECK_EVAL("tes++++", "${cut:3,++++,test}"); + WEE_CHECK_EVAL("tes++++", "${cutscr:3,++++,test}"); + WEE_CHECK_EVAL("tes…", "${cut:3,…,test}"); + WEE_CHECK_EVAL("tes…", "${cutscr:3,…,test}"); + WEE_CHECK_EVAL("te+", "${cut:+3,+,test}"); + WEE_CHECK_EVAL("te+", "${cutscr:+3,+,test}"); + WEE_CHECK_EVAL("…", "${cut:+3,…,test}"); + WEE_CHECK_EVAL("te…", "${cutscr:+3,…,test}"); + WEE_CHECK_EVAL("t++", "${cut:+3,++,test}"); + WEE_CHECK_EVAL("t++", "${cutscr:+3,++,test}"); + WEE_CHECK_EVAL("+++", "${cut:+3,+++,test}"); + WEE_CHECK_EVAL("+++", "${cutscr:+3,+++,test}"); + WEE_CHECK_EVAL("", "${cut:+3,++++,test}"); + WEE_CHECK_EVAL("", "${cutscr:+3,++++,test}"); + + WEE_CHECK_EVAL("test", "${cut:4,,test}"); + WEE_CHECK_EVAL("test", "${cutscr:4,,test}"); + WEE_CHECK_EVAL("test", "${cut:+4,,test}"); + WEE_CHECK_EVAL("test", "${cutscr:+4,,test}"); + + WEE_CHECK_EVAL("test", "${cut:4,+,test}"); + WEE_CHECK_EVAL("test", "${cutscr:4,+,test}"); + WEE_CHECK_EVAL("test", "${cut:+4,+,test}"); + WEE_CHECK_EVAL("test", "${cutscr:+4,+,test}"); + WEE_CHECK_EVAL("éà", "${cut:2,,éàô}"); WEE_CHECK_EVAL("éà", "${cutscr:2,,éàô}"); diff --git a/tests/unit/core/test-string.cpp b/tests/unit/core/test-string.cpp index 19e7c89c4..a7bc807de 100644 --- a/tests/unit/core/test-string.cpp +++ b/tests/unit/core/test-string.cpp @@ -123,6 +123,8 @@ TEST(String, Duplicate) POINTERS_EQUAL(NULL, string_strndup (NULL, 0)); + POINTERS_EQUAL(NULL, string_strndup (str_test, -1)); + str = string_strndup (str_test, 0); CHECK(str); CHECK(str != str_test); |