summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/single.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/single.lua b/tests/single.lua
index 4bd159c..d9b6ce9 100644
--- a/tests/single.lua
+++ b/tests/single.lua
@@ -99,3 +99,9 @@ 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) == '')
+
+if string.packsize("i") == 4 then
+ -- result length would be 2^31 (int overflow)
+ checkerror("too large", string.rep, 'aa', (1 << 30))
+ checkerror("too large", string.rep, 'a', (1 << 30), ',')
+end