From f893be002aebd215b499b0c72803dd1346f4eb05 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 12:23:30 +0100 Subject: Fixed bad lua_tointegerx --- tests/single.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/single.lua') 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 -- cgit v1.2.3-54-g00ecf