aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 12:23:30 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 12:23:30 +0100
commitf893be002aebd215b499b0c72803dd1346f4eb05 (patch)
treea2c83ccfacfb50e3dd1487e2d8b7562fafc4bb5c /tests
parent16cdb860e9e8e5550c1178a41eabb52e461ffa46 (diff)
downloadfengari-f893be002aebd215b499b0c72803dd1346f4eb05.tar.gz
fengari-f893be002aebd215b499b0c72803dd1346f4eb05.tar.bz2
fengari-f893be002aebd215b499b0c72803dd1346f4eb05.zip
Fixed bad lua_tointegerx
Diffstat (limited to 'tests')
-rw-r--r--tests/single.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/single.lua b/tests/single.lua
index 4960b11..f74c096 100644
--- a/tests/single.lua
+++ b/tests/single.lua
@@ -131,3 +131,10 @@ assert(tostring(-1203) == "-1203")
assert(tostring(1203.125) == "1203.125")
assert(tostring(-0.5) == "-0.5")
assert(tostring(-32767) == "-32767")
+if math.tointeger(2147483647) then -- no overflow? (32 bits)
+ assert(tostring(-2147483647) == "-2147483647")
+end
+if math.tointeger(4611686018427387904) then -- no overflow? (64 bits)
+ assert(tostring(4611686018427387904) == "4611686018427387904")
+ assert(tostring(-4611686018427387904) == "-4611686018427387904")
+end