<!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>Sergey,<br>
</p>
<div class="moz-cite-prefix">On 21.08.2024 11:58, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:e00e030977ae37607f590a0204498739c4a51751.1724228998.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">This patch moves the aforementioned test from the <misc> to the <lang/>
directory (with slightly renaming to be consistent with other names),
includes it in <index>, and names the subtests.
Part of tarantool/tarantool#9398
---</pre>
</blockquote>
thanks for the patch! LGTM<br>
<blockquote type="cite"
cite="mid:e00e030977ae37607f590a0204498739c4a51751.1724228998.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
.../{misc/recurse_deep.lua => lang/deep_recursion.lua} | 8 +++-----
test/LuaJIT-tests/lang/index | 1 +
2 files changed, 4 insertions(+), 5 deletions(-)
rename test/LuaJIT-tests/{misc/recurse_deep.lua => lang/deep_recursion.lua} (84%)
diff --git a/test/LuaJIT-tests/misc/recurse_deep.lua b/test/LuaJIT-tests/lang/deep_recursion.lua
similarity index 84%
rename from test/LuaJIT-tests/misc/recurse_deep.lua
rename to test/LuaJIT-tests/lang/deep_recursion.lua
index 9b9af295..732dd529 100644
--- a/test/LuaJIT-tests/misc/recurse_deep.lua
+++ b/test/LuaJIT-tests/lang/deep_recursion.lua
@@ -1,5 +1,4 @@
-
-do
+do --- Recursion sum.
local function sum(n)
if n == 1 then return 1 end
return n + sum(n-1)
@@ -7,7 +6,7 @@ do
assert(sum(200) == 20100)
end
-do
+do --- Recursion wiht pcall.
local pcall = pcall
local tr1
local x = 0
@@ -19,11 +18,10 @@ do
assert(tr1(200) == true and x == 200)
end
-do
+do --- Recursion fibonacci.
local function fib(n)
if n < 2 then return 1 end
return fib(n-2) + fib(n-1)
end
assert(fib(15) == 987)
end
-
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 726c8d16..5c9e7ea4 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
+deep_recursion.lua
dualnum.lua
for.lua
hook_active.lua
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>