[Tarantool-patches] [PATCH v2 luajit 09/45] test: refactor <lang/dualnum.lua> LuaJIT test

Sergey Kaplun skaplun at tarantool.org
Wed Aug 21 11:58:12 MSK 2024


This patch refactors the aforementioned test to make its code style
closer to ours.

Relates to tarantool/tarantool#9398
---
 test/LuaJIT-tests/lang/dualnum.lua | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/LuaJIT-tests/lang/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
index d0b1e5d2..bc52b742 100644
--- a/test/LuaJIT-tests/lang/dualnum.lua
+++ b/test/LuaJIT-tests/lang/dualnum.lua
@@ -2,31 +2,31 @@
 
 do --- Positive overflow.
   local x = 0
-  for i=2147483446,2147483647,2 do x = x + 1 end
+  for _ = 2147483446, 2147483647, 2 do x = x + 1 end
   assert(x == 101)
 end
 
 do --- Negative overflow.
   local x = 0
-  for i=-2147483447,-2147483648,-2 do x = x + 1 end
+  for _ = -2147483447, -2147483648, -2 do x = x + 1 end
   assert(x == 101)
 end
 
 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
-    for j=a,b,c do end
+  for _ = 1, 20 do
+    for _ = a, b, c do end
   end
 end
 
 do --- min/max correctness.
   local function fmin(a, b)
-    for i=1,100 do a = math.min(a, b) end
+    for _ = 1, 100 do a = math.min(a, b) end
     return a
   end
   local function fmax(a, b)
-    for i=1,100 do a = math.max(a, b) end
+    for _ = 1, 100 do a = math.max(a, b) end
     return a
   end
   assert(fmin(1, 3) == 1)
-- 
2.45.2



More information about the Tarantool-patches mailing list