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 5346BDFE59F; Fri, 6 Dec 2024 14:18:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5346BDFE59F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1733483934; bh=6NTlxdcWeHAERSqd495cZmaonwXTwgLHjw+Oluaxga4=; 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=YZm+j+plut1km99thcT0pDSa0cV6HOSvq8Sroqk1nPMQduZUNniSAKjhPBNCOSNm3 sm50imFg+pTQa75wO3A9HE1ONzscjkjyrX8PsYQ4zfYGmZ4pCpQm+Ffr5x1HxLt7d2 1RAeBFWW3n9s/Trgi7hS8KXIWHt6Vhv8WrtYgkrs= Received: from send220.i.mail.ru (send220.i.mail.ru [95.163.59.59]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 93BF8DFE59A for ; Fri, 6 Dec 2024 14:18:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 93BF8DFE59A Received: by exim-smtp-57cd6dcbd5-6vxqk with esmtpa (envelope-from ) id 1tJWMF-000000005rm-3AZq; Fri, 06 Dec 2024 14:18:52 +0300 Date: Fri, 6 Dec 2024 14:17:57 +0300 To: Sergey Bronnikov Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9008082F162C50007A53896C97B9A26DB921E4202562039A0182A05F53808504045E8F962A2BD91A53DE06ABAFEAF67054BC5EAD3BF2EAEE188B677858ECA0350DABA3F7B65B49C8A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE716FAD50E497B9C14EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BA14B6CBCF09CA1D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C587C33A754F940FB61C73BB8BE306920881976EE6C97355CC7F00164DA146DAFE8445B8C89999728AA50765F79006372A3B24BF85B2E607389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC821E93C0F2A571C7BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD181150BA43C84913FC3A03B725D353964B1D471462564A2E1935872C767BF85DA227C277FBC8AE2E8BC6A536F79815AD9275ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5165340C0B56B406D5002B1117B3ED696AB95983AF013F9F447A99E6294EE8661823CB91A9FED034534781492E4B8EEAD09122B91796FF21FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF2312A21E06DBA7CA9408B86BF76E81D038DB0B8BD609D7F11508964AA345B1B6500AA17B1AA25A4F494E10A735AF7C934540FC9F59FAAC40EFC489646C4D432E0B9199680305CCDC5F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojOp8qHLJs/nQusZh3vT6/DQ== X-DA7885C5: A53E43660791E776F255D290C0D534F94533EBA9885023D532A3DEDC1A68DD440EE1F24165B649475B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F739381B31377CF4CA219AAE287F9D66A8C98DDF09131564DE6C7909B67736315A97BE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] test: support number value of tag in LuaJIT-tests 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, Sergey! Thanks for the review! See my answers below. On 06.12.24, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! > LGTM with minor comment below. > > On 16:42 Thu 05 Dec , Sergey Kaplun wrote: > >The LuaJIT-tests suite lacks the ability to specify tags with custom > >values. This patch adds the ability to specify number tags in the format > >`+tag=number`. It is useful for version specification of system > >libraries (like libc). > > Usually, for such janitorial patches we add a note like > "Required by the following patch". Added the following line: | Required for the next patch. > > >--- > > test/LuaJIT-tests/test.lua | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > >diff --git a/test/LuaJIT-tests/test.lua b/test/LuaJIT-tests/test.lua > >index ab178331..2a535605 100644 > >--- a/test/LuaJIT-tests/test.lua > >+++ b/test/LuaJIT-tests/test.lua > >@@ -161,7 +161,12 @@ local function parse_args(t) > > error(arg .." does not expect an argument") > > end > > elseif arg:find"^[-+]" then > >- opts.tags[arg:sub(2)] = (arg:sub(1, 1) == "+") > >+ local tagval = arg:find"=" > >+ if tagval then > >+ opts.tags[arg:sub(2, tagval - 1)] = tonumber(arg:sub(tagval + 1)) > > I would also check a type here: > > --- a/test/LuaJIT-tests/test.lua > +++ b/test/LuaJIT-tests/test.lua > @@ -162,7 +162,7 @@ local function parse_args(t) > end > elseif arg:find"^[-+]" then > local tagval = arg:find"=" > - if tagval then > + if tagval and type(tagval) == 'number' then > opts.tags[arg:sub(2, tagval - 1)] = tonumber(arg:sub(tagval + 1)) > else > opts.tags[arg:sub(2)] = (arg:sub(1, 1) == "+") This check is excess, see the `string.find()` documentation [1]: | If it finds a match, then `find` returns the indices of `s` where this | occurrence starts and ends; otherwise, it returns `nil`. We have only two options here: a number or `nil`, so this `if` check is just enough. > > >+ else > >+ opts.tags[arg:sub(2)] = (arg:sub(1, 1) == "+") > >+ end > > elseif arg:find"^%d+$" then > > if not opts.numbers_to_run then > > opts.numbers_to_run = {} > >-- > >2.47.0 > > > > -- > sergeyb@ [1]: https://www.lua.org/manual/5.1/manual.html#pdf-string.find -- Best regards, Sergey Kaplun