diff options
Diffstat (limited to 'testes')
-rw-r--r-- | testes/code.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testes/code.lua b/testes/code.lua index 329619f1..08b3e23f 100644 --- a/testes/code.lua +++ b/testes/code.lua | |||
@@ -460,5 +460,16 @@ do -- check number of available registers | |||
460 | assert(string.find(msg, "too many registers")) | 460 | assert(string.find(msg, "too many registers")) |
461 | end | 461 | end |
462 | 462 | ||
463 | |||
464 | do -- basic check for SETLIST | ||
465 | -- create a list constructor with 50 elements | ||
466 | local source = "local a; return {" .. string.rep("a, ", 50) .. "}" | ||
467 | local func = assert(load(source)) | ||
468 | local code = table.concat(T.listcode(func), "\n") | ||
469 | local _, count = string.gsub(code, "SETLIST", "") | ||
470 | -- code uses only 1 SETLIST for the constructor | ||
471 | assert(count == 1) | ||
472 | end | ||
473 | |||
463 | print 'OK' | 474 | print 'OK' |
464 | 475 | ||