<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<p>dualnum is an optional LuaJIT feature (LJ_DUALNUM), why we don't
have a separate flag for</p>
<p>the test that will disable test when feature is not available?</p>
<p><br>
</p>
<p><br>
</p>
<p></p>
<div class="moz-cite-prefix">On 15.08.2024 16:11, Sergey Bronnikov
via Tarantool-patches wrote:<br>
</div>
<blockquote type="cite"
cite="mid:52343605-6c27-4f5e-8cef-7a350d378261@tarantool.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hi, Sergey</p>
<p>thanks for the patch!</p>
<p>see my comments below<br>
</p>
<div class="moz-cite-prefix">On 14.08.2024 16:55, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0b86cd86732162470eea910ae9cdea48219e53bd.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">This patch moves the aforementioned test from the <misc> to the <lang/>
directory, includes it in <index>, and names subtests.
</pre>
</blockquote>
<p>Add a reason for this and couple of words about updated
formatting in the test.</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:0b86cd86732162470eea910ae9cdea48219e53bd.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/{misc => lang}/dualnum.lua | 24 +++++++++-----------
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 12 insertions(+), 13 deletions(-)
rename test/LuaJIT-tests/{misc => lang}/dualnum.lua (57%)
diff --git a/test/LuaJIT-tests/misc/dualnum.lua b/test/LuaJIT-tests/lang/dualnum.lua
similarity index 57%
rename from test/LuaJIT-tests/misc/dualnum.lua
rename to test/LuaJIT-tests/lang/dualnum.lua
index 5f1288c8..688920eb 100644
--- a/test/LuaJIT-tests/misc/dualnum.lua
+++ b/test/LuaJIT-tests/lang/dualnum.lua
@@ -1,34 +1,32 @@
+-- Test LuaJIT Dualnum mode behaviour.
--- Positive overflow
-do
+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
--- Negative overflow
-do
+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
--- 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
- for j=a,b,c do end
+ for i = 1, 20 do
+ for j = a, b, c do end
end
end
-do
+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)
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
</pre>
</blockquote>
<lt-container></lt-container>
</blockquote>
</body>
</html>