diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/core/test-core-eval.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/core/test-core-eval.cpp b/tests/unit/core/test-core-eval.cpp index e1d9a3cff..248c680fe 100644 --- a/tests/unit/core/test-core-eval.cpp +++ b/tests/unit/core/test-core-eval.cpp @@ -516,6 +516,25 @@ TEST(CoreEval, EvalExpression) WEE_CHECK_EVAL("\t", "${\\t}"); WEE_CHECK_EVAL("\t", "${esc:\t}"); + /* test range of chars */ + WEE_CHECK_EVAL("0123456789", "${chars:digit}"); + WEE_CHECK_EVAL("0123456789abcdefABCDEF", "${chars:xdigit}"); + WEE_CHECK_EVAL("abcdefghijklmnopqrstuvwxyz", "${chars:lower}"); + WEE_CHECK_EVAL("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "${chars:upper}"); + WEE_CHECK_EVAL("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "${chars:alpha}"); + WEE_CHECK_EVAL("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789", "${chars:alnum}"); + WEE_CHECK_EVAL("0123456789", "${chars:0-9}"); + WEE_CHECK_EVAL("abcdefgh", "${chars:a-h}"); + WEE_CHECK_EVAL("JKLMNOPQRSTUV", "${chars:J-V}"); + WEE_CHECK_EVAL("é", "${chars:é-é}"); + WEE_CHECK_EVAL("àáâãäåæçèé", "${chars:à-é}"); + WEE_CHECK_EVAL("←↑→↓", "${chars:←-↓}"); /* U+2190 - U+2193 */ + WEE_CHECK_EVAL("▁▂▃▄▅▆▇█▉▊▋▌▍▎▏", "${chars:▁-▏}"); /* U+2581 - U+258F */ + WEE_CHECK_EVAL("", "${chars:Z-A}"); /* invalid (reverse) */ + /* test case conversion: to lower case */ WEE_CHECK_EVAL("", "${lower:}"); WEE_CHECK_EVAL("this is a test", "${lower:This is a TEST}"); |