mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
core: add range of chars in evaluation of expressions with chars:xxx
This commit is contained in:
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user