diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 11:05:51 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-03-24 11:05:51 +0100 |
commit | 00340610e70f3651d267a210e2c2914f1102d086 (patch) | |
tree | b7b627aaf45df77bb6d2984d93b998f5954feec5 /tests | |
parent | a6fa99b44b6d536a1fb23f9ffd7a84786c63edab (diff) | |
download | fengari-00340610e70f3651d267a210e2c2914f1102d086.tar.gz fengari-00340610e70f3651d267a210e2c2914f1102d086.tar.bz2 fengari-00340610e70f3651d267a210e2c2914f1102d086.zip |
string.rep: don't repeat if n == 0
Diffstat (limited to 'tests')
-rw-r--r-- | tests/single.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/single.lua b/tests/single.lua index c52a6fb..4bd159c 100644 --- a/tests/single.lua +++ b/tests/single.lua @@ -93,3 +93,9 @@ assert(string.char(0, string.byte("\xe4"), 0) == "\0\xe4\0") assert(string.char(string.byte("\xe4l\0óu", 1, -1)) == "\xe4l\0óu") assert(string.char(string.byte("\xe4l\0óu", 1, 0)) == "") assert(string.char(string.byte("\xe4l\0óu", -10, 100)) == "\xe4l\0óu") + +assert(string.upper("ab\0c") == "AB\0C") +assert(string.lower("\0ABCc%$") == "\0abcc%$") +assert(string.rep('teste', 0) == '') +assert(string.rep('tés\00tê', 2) == 'tés\0têtés\000tê') +assert(string.rep('', 10) == '') |