[Tarantool-patches] [PATCH v2 luajit 16/26] test: enable <ffi_metatype.lua> in LuaJIT-tests
Sergey Kaplun
skaplun at tarantool.org
Tue Feb 6 16:48:32 MSK 2024
Hi, Sergey!
Thanks for the review!
Fixed your comment below.
On 05.02.24, Sergey Bronnikov wrote:
> Hi, Sergey
>
> thanks for the patch! LGTM with a minor comment
>
> On 1/29/24 13:45, Sergey Kaplun wrote:
<snipped>
> > @@ -14,7 +14,7 @@ local function ptreq(a, b)
> > return ffi.cast("void *", a) == ffi.cast("void *", b)
> > end
> >
> > -do
> > +do --- metatype index newindex
>
> isn't better: "metatype with index and newindex metamethods" or smthing
> like this?
>
> This descriptions are for humans mostly and would be better to convert
> these keywords to readable sentence.
>
> same for test names below
Fixed. See the iterative patch below:
===================================================================
diff --git a/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua b/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua
index b0054b1a..3fea5341 100644
--- a/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua
+++ b/test/LuaJIT-tests/lib/ffi/ffi_metatype.lua
@@ -14,7 +14,7 @@ local function ptreq(a, b)
return ffi.cast("void *", a) == ffi.cast("void *", b)
end
-do --- metatype index newindex
+do --- metatype with index and newindex metamethods
local nidx = {}
local tp = ffi.metatype("idx1_t", {
__index = { foo = 99, method = function(c, v) return v end },
@@ -45,7 +45,7 @@ do --- metatype index newindex
fails(function(cp) cp.bar = 42 end, cp)
end
-do --- metatype index newindex with upvalues
+do --- index and newindex metamethods use upvalues
local uc, uk, uv
local tp = ffi.metatype("idx2_t", {
__index = function(c, k, x, y)
@@ -78,7 +78,7 @@ do --- metatype index newindex with upvalues
fails(function(p) p[0] = 11 end, p)
end
-do --- metatype index newindex with upvalues via setmetatable
+do --- index and newindex metamethods as metaobjects use upvalues
local uc, uk, uv
local ti, tn = {}, {}
local tp = ffi.metatype("idx3_t", {
===================================================================
>
<snipped>
> > jit_complex.lua
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list