<!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>Hi, Sergey</p>
<p>thanks for the patch<br>
</p>
<div class="moz-cite-prefix">On 14.08.2024 16:55, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0e0515a6a5ac5984b8c281c1b01623d58f03ce3b.1723638851.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.</pre>
</blockquote>
<p>please describe a reason of moving and say in commit message</p>
<p>that patch also added comments and changed formatting.<br>
</p>
<blockquote type="cite"
cite="mid:0e0515a6a5ac5984b8c281c1b01623d58f03ce3b.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/gc_step.lua | 39 ++++++++++++++++++++++++++++++
test/LuaJIT-tests/lang/index | 1 +
test/LuaJIT-tests/misc/gcstep.lua | 33 -------------------------
3 files changed, 40 insertions(+), 33 deletions(-)
create mode 100644 test/LuaJIT-tests/lang/gc_step.lua
delete mode 100644 test/LuaJIT-tests/misc/gcstep.lua
diff --git a/test/LuaJIT-tests/lang/gc_step.lua b/test/LuaJIT-tests/lang/gc_step.lua
new file mode 100644
index 00000000..756d7a61
--- /dev/null
+++ b/test/LuaJIT-tests/lang/gc_step.lua
@@ -0,0 +1,39 @@
+local function testgc(what, func)
+ collectgarbage()
+ local oc = gcinfo()
+ func()
+ local nc = gcinfo()
+ assert(nc < oc * 4, "GC step missing for " .. what)
+end
+
+do --- TNEW
+ testgc("TNEW", function()
+ for _ = 1, 10000 do
+ local _ = {}
+ end
+ end)
+end
+
+do --- TDUP
+ testgc("TDUP", function()
+ for _ = 1, 10000 do
+ local _ = {1}
+ end
+ end)
+end
+
+do --- FNEW
+ testgc("FNEW", function()
+ for _ = 1, 10000 do
+ local function _() end
+ end
+ end)
+end
+
+do --- CAT
+ testgc("CAT", function()
+ for i = 1, 10000 do
+ local _ = "x" .. i
+ end
+ end)
+end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index b0e7f073..274425bf 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -19,5 +19,6 @@ tail_recursion.lua
vararg_jit.lua
gc.lua
gc_debug.lua
+gc_step.lua
goto.lua +goto
meta
diff --git a/test/LuaJIT-tests/misc/gcstep.lua b/test/LuaJIT-tests/misc/gcstep.lua
deleted file mode 100644
index 533356b7..00000000
--- a/test/LuaJIT-tests/misc/gcstep.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-
-local function testgc(what, func)
- collectgarbage()
- local oc = gcinfo()
- func()
- local nc = gcinfo()
- assert(nc < oc*4, "GC step missing for "..what)
-end
-
-testgc("TNEW", function()
- for i=1,10000 do
- local t = {}
- end
-end)
-
-testgc("TDUP", function()
- for i=1,10000 do
- local t = {1}
- end
-end)
-
-testgc("FNEW", function()
- for i=1,10000 do
- local function f() end
- end
-end)
-
-testgc("CAT", function()
- for i=1,10000 do
- local s = "x"..i
- end
-end)
-
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>