aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testes/strings.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/testes/strings.lua b/testes/strings.lua
index c124b369..a0204309 100644
--- a/testes/strings.lua
+++ b/testes/strings.lua
@@ -109,10 +109,9 @@ assert(string.rep('teste', 0) == '')
109assert(string.rep('tés\00tê', 2) == 'tés\0têtés\000tê') 109assert(string.rep('tés\00tê', 2) == 'tés\0têtés\000tê')
110assert(string.rep('', 10) == '') 110assert(string.rep('', 10) == '')
111 111
112if string.packsize("i") == 4 then 112do
113 -- result length would be 2^31 (int overflow) 113 checkerror("too large", string.rep, 'aa', math.maxinteger);
114 checkerror("too large", string.rep, 'aa', (1 << 30)) 114 checkerror("too large", string.rep, 'a', math.maxinteger/2, ',')
115 checkerror("too large", string.rep, 'a', (1 << 30), ',')
116end 115end
117 116
118-- repetitions with separator 117-- repetitions with separator