<!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:364dac6837a1a1a7247c9cb375a6da8771d3c050.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>
<p>thanks for the patch! Please adjust a width of lines in commit
message.</p>
<p>LGTM<br>
</p>
<blockquote type="cite"
cite="mid:364dac6837a1a1a7247c9cb375a6da8771d3c050.1724228998.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
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>