From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 572FA6EC40; Mon, 20 Sep 2021 11:30:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 572FA6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1632126626; bh=Z6t8J4SSxA+anf/93v1CoEFVv4mddUOZ2VjELG8Cj2k=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Cq/DYXR/5e21qZE0V+h6FqDYxTRNt5HgRANHVseSYwT2u7LC36KvRIPHnhjyl6Hv0 8U1DKzaPbd6weZ3eiEveaeLIQG40/5osOE3vU221MDn5W2JWoknI+Pds8kD4XyYs+r nGIuPjLYAdBc8xuOQI8Dq/UVRZAS10GgMaoDI/4M= Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 376986EC40 for ; Mon, 20 Sep 2021 11:30:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 376986EC40 Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1mSEgx-0003ZX-A3; Mon, 20 Sep 2021 11:30:23 +0300 Date: Mon, 20 Sep 2021 11:28:52 +0300 To: sergos Message-ID: References: <0d207e1a15360109e1e9c4bb775248f0fc04edc6.1631170629.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2FECE56E2A292C9F7D3C69CC5C84EEB3A800894C459B0CD1B9D111741FA4AA11218CA26794CCE963625A8F4BA26F796B49AA2292145287427F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73AA63C5F29446501EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006370BEBC60587DC626C8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8DD62FE4837E704C08DF787B07D167F1C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6AC294AFEFA671E80089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5FA247A7597689C7EA171FACA21AE3D660CF2076D1666FD76D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75DD5744CF7ED0C6846D6546786ADF492D5A0AA20F8A030721AEF7A422EC9C26712120514CE2D1D3528E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F8A2DF183797A6A8B11C11F2AC7668E5E79073A06CE9800BB56815C07A7BCAB16875A6B187A1336D1D7E09C32AA3244C3DC463D232646576D3FEAB49927586186C24832127668422FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojsFc9NKou+3iB15oRKx8OTw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB47AA601109991D62529D71D49E108881B16EB02AD062DA36EF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/3] test: fix path storage for non-concatable objects X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergos! Thanks for the review! On 15.09.21, sergos wrote: > Hi! > Thanks for the patch! > > > On 9 Sep 2021, at 10:03, Sergey Kaplun wrote: > > > > When the key of a table to compare via `tap.test:is_deeply()` is > > non-concatable object (i.e. lightuserdata) concatenation with path > ^^^^ does it mean the object has no __concat, while has __tostring? > > As a result: is there a case an object has no __tostring? Yes, for example, userdata may have no neither __tostring, nor __concat metamethod, but tostring() will show us its value and prevent raising an error. | luajit -e 'print(getmetatable(newproxy(true)).__tostring, getmetatable(newproxy(true)).__concat); local r = "ud: "..tostring(newproxy()) print(r)' | nil nil | ud: userdata: 0x41edce48 > > > raises an error. > > > > This patch converts object to string to avoid this error. > > > > Needed for tarantool/tarantool#5629 > > --- > > test/tarantool-tests/tap.lua | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/test/tarantool-tests/tap.lua b/test/tarantool-tests/tap.lua > > index 44fcac3d..a1f54d20 100644 > > --- a/test/tarantool-tests/tap.lua > > +++ b/test/tarantool-tests/tap.lua > > @@ -166,7 +166,7 @@ local function is_deeply(test, got, expected, message, extra) > > > > for k, v in pairs(got) do > > has[k] = true > > - extra.path = path .. "." .. k > > + extra.path = path .. "." .. tostring(k) > > if not cmpdeeply(v, expected[k], extra) then > > return false > > end > > @@ -175,7 +175,7 @@ local function is_deeply(test, got, expected, message, extra) > > -- Check if expected contains more keys then got. > > for k, v in pairs(expected) do > > if has[k] ~= true and (extra.strict or v ~= NULL) then > > - extra.path = path .. "." .. k > > + extra.path = path .. "." .. tostring(k) > > extra.expected = "key (exists): " .. tostring(k) > > extra.got = "key (missing): " .. tostring(k) > > return false > > -- > > 2.31.0 > > > -- Best regards, Sergey Kaplun