diff options
Diffstat (limited to 'testes')
| -rw-r--r-- | testes/code.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testes/code.lua b/testes/code.lua index 633f4896..380ff70c 100644 --- a/testes/code.lua +++ b/testes/code.lua | |||
| @@ -482,5 +482,23 @@ do -- basic check for SETLIST | |||
| 482 | assert(count == 1) | 482 | assert(count == 1) |
| 483 | end | 483 | end |
| 484 | 484 | ||
| 485 | |||
| 486 | do print("testing code for integer limits") | ||
| 487 | local function checkints (n) | ||
| 488 | local source = string.format( | ||
| 489 | "local a = {[true] = 0X%x}; return a[true]", n) | ||
| 490 | local f = assert(load(source)) | ||
| 491 | checkKlist(f, {n}) | ||
| 492 | assert(f() == n) | ||
| 493 | f = load(string.dump(f)) | ||
| 494 | assert(f() == n) | ||
| 495 | end | ||
| 496 | |||
| 497 | checkints(math.maxinteger) | ||
| 498 | checkints(math.mininteger) | ||
| 499 | checkints(-1) | ||
| 500 | |||
| 501 | end | ||
| 502 | |||
| 485 | print 'OK' | 503 | print 'OK' |
| 486 | 504 | ||
