[Tarantool-patches] [PATCH v2 luajit 08/45] test: enable <misc/dualnum.lua> LuaJIT test
Sergey Kaplun
skaplun at tarantool.org
Wed Aug 21 11:58:11 MSK 2024
This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names subtests.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/{misc => lang}/dualnum.lua | 12 +++++-------
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 6 insertions(+), 7 deletions(-)
rename test/LuaJIT-tests/{misc => lang}/dualnum.lua (82%)
diff --git a/test/LuaJIT-tests/misc/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
similarity index 82%
rename from test/LuaJIT-tests/misc/dualnum.lua
rename to test/LuaJIT-tests/lang/dualnum.lua
index 5f1288c8..d0b1e5d2 100644
--- a/test/LuaJIT-tests/misc/dualnum.lua
+++ b/test/LuaJIT-tests/lang/dualnum.lua
@@ -1,20 +1,18 @@
+-- Test LuaJIT Dualnum mode behaviour.
--- Positive overflow
-do
+do --- Positive overflow.
local x = 0
for i=2147483446,2147483647,2 do x = x + 1 end
assert(x == 101)
end
--- Negative overflow
-do
+do --- Negative overflow.
local x = 0
for i=-2147483447,-2147483648,-2 do x = x + 1 end
assert(x == 101)
end
--- SLOAD with number to integer conversion.
-do
+do --- SLOAD with number to integer conversion.
local k = 1
local a, b, c = 1/k, 20/k, 1/k
for i=1,20 do
@@ -22,7 +20,7 @@ do
end
end
-do
+do --- min/max correctness.
local function fmin(a, b)
for i=1,100 do a = math.min(a, b) end
return a
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 4d9feafd..b0e7f073 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -6,6 +6,7 @@ catch_wrap.lua
compare.lua
compare_nan.lua
constant
+dualnum.lua
for.lua
length.lua
lightud.lua
--
2.45.2
More information about the Tarantool-patches
mailing list