[Tarantool-patches] [PATCH v2 luajit 28/45] test: enable <misc/recurse_deep.lua> LuaJIT test

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


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
---
 .../{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
-- 
2.45.2



More information about the Tarantool-patches mailing list