<!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! Please see my comments.<br>
</p>
<div class="moz-cite-prefix">On 14.08.2024 16:55, Sergey Kaplun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:8e9e2481942c2c98a1e7f078e71b29edab252fae.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">This patch refactors the <lang/coroutine.lua> test by adding a simple
check for the content of a `debug.traceback()` result. Also, the test is
moved to the <lib/coroutine/> directory.</pre>
</blockquote>
<p><span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span
class="ryNqvb">The category for the test is debatable.</span></span></span></p>
<p><span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span
class="ryNqvb">In fact, the test target is a function from
`debug` module,</span></span></span></p>
<p><span class="HwtZe" lang="en"><span class="jCAhz ChMk0b"><span
class="ryNqvb">not coroutines.<br>
</span></span></span></p>
<blockquote type="cite"
cite="mid:8e9e2481942c2c98a1e7f078e71b29edab252fae.1723638851.git.skaplun@tarantool.org">
<pre class="moz-quote-pre" wrap="">
Also, it removes the <misc/coro_traceback.lua> since it is the same test
that wasn't cleaned up during the refactoring in the original
repository.
Part of tarantool/tarantool#9398
---
test/LuaJIT-tests/lang/coroutine.lua | 8 --------
test/LuaJIT-tests/lang/index | 1 -
test/LuaJIT-tests/lib/coroutine/index | 1 +
test/LuaJIT-tests/lib/coroutine/traceback.lua | 14 ++++++++++++++
test/LuaJIT-tests/misc/coro_traceback.lua | 8 --------
5 files changed, 15 insertions(+), 17 deletions(-)
delete mode 100644 test/LuaJIT-tests/lang/coroutine.lua
create mode 100644 test/LuaJIT-tests/lib/coroutine/traceback.lua
delete mode 100644 test/LuaJIT-tests/misc/coro_traceback.lua
diff --git a/test/LuaJIT-tests/lang/coroutine.lua b/test/LuaJIT-tests/lang/coroutine.lua
deleted file mode 100644
index 405135c9..00000000
--- a/test/LuaJIT-tests/lang/coroutine.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-do --- traceback
- local co = coroutine.create(function()
- local x = nil
- local y = x.x
- end)
- assert(coroutine.resume(co) == false)
- debug.traceback(co)
-end
diff --git a/test/LuaJIT-tests/lang/index b/test/LuaJIT-tests/lang/index
index 4ff7a297..803f32d8 100644
--- a/test/LuaJIT-tests/lang/index
+++ b/test/LuaJIT-tests/lang/index
@@ -14,7 +14,6 @@ concat.lua
self.lua
table.lua
upvalue
-coroutine.lua
tail_recursion.lua
vararg_jit.lua
gc.lua
diff --git a/test/LuaJIT-tests/lib/coroutine/index b/test/LuaJIT-tests/lib/coroutine/index
index 9c5c17ec..c4dc6cf1 100644
--- a/test/LuaJIT-tests/lib/coroutine/index
+++ b/test/LuaJIT-tests/lib/coroutine/index
@@ -1 +1,2 @@
+traceback.lua
yield.lua
diff --git a/test/LuaJIT-tests/lib/coroutine/traceback.lua b/test/LuaJIT-tests/lib/coroutine/traceback.lua
new file mode 100644
index 00000000..2b900ef1
--- /dev/null
+++ b/test/LuaJIT-tests/lib/coroutine/traceback.lua
@@ -0,0 +1,14 @@
+do --- traceback
+ local function badfunc()
+ local x = nil
+ local y = x.x
+ end
+
+ local co = coroutine.create(badfunc)
+ assert(coroutine.resume(co) == false)
+
+ local traceback = debug.traceback(co)
+ local line = debug.getinfo(badfunc).linedefined
+
+ assert(traceback:match('traceback:.*:' .. line))
+end
diff --git a/test/LuaJIT-tests/misc/coro_traceback.lua b/test/LuaJIT-tests/misc/coro_traceback.lua
deleted file mode 100644
index 2676d2c6..00000000
--- a/test/LuaJIT-tests/misc/coro_traceback.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-
-local co = coroutine.create(function()
- local x = nil
- local y = x.x
-end)
-assert(coroutine.resume(co) == false)
-debug.traceback(co)
-
</pre>
</blockquote>
</body>
<lt-container></lt-container>
</html>