diff options
Diffstat (limited to '')
-rw-r--r-- | testes/strings.lua | 7 |
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) == '') | |||
109 | assert(string.rep('tés\00tê', 2) == 'tés\0têtés\000tê') | 109 | assert(string.rep('tés\00tê', 2) == 'tés\0têtés\000tê') |
110 | assert(string.rep('', 10) == '') | 110 | assert(string.rep('', 10) == '') |
111 | 111 | ||
112 | if string.packsize("i") == 4 then | 112 | do |
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), ',') | ||
116 | end | 115 | end |
117 | 116 | ||
118 | -- repetitions with separator | 117 | -- repetitions with separator |