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 89BEF6EC5D; Fri, 2 Apr 2021 10:22:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 89BEF6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617348143; bh=8gsNxFO5whIn2ibJBGVx6Ru95SGDugSgyz4GirfZYK4=; 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=BKmJpwysb1r/iTtdvIRuh71Mtp0nIJfjb2VAUXFECdOq6Z1D63ixsdS3yOMwlg9fi gMu0l3xChnXGSzEplFT3VYhKLOjKEVHKQdTTzKK9su/TajRGtg4W3ji/9TbJSXuY/8 Pz84mpSZ0izcXyAGo97jtNrbF8t6iD7JZyAxjxGY= Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (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 AC24C6EC5D for ; Fri, 2 Apr 2021 10:22:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AC24C6EC5D Received: by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1lSE8K-0005vH-Qf; Fri, 02 Apr 2021 10:22:21 +0300 Date: Fri, 2 Apr 2021 10:21:26 +0300 To: Igor Munkin Message-ID: References: <422eaeb77d4cb957338af0bdc0151ae7787e1567.1616743343.git.skaplun@tarantool.org> <20210331095145.GG29703@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210331095145.GG29703@tarantool.org> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32941B7C4A78AC10F96A7797F60C25BD4B06182A05F53808504003D94327BFE1A8ECB2820EF8C48B1E05B43FBD525486FD2ABFF63A0534926395 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70043D879A87EF1BCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF19945FAF91394A8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C7B5A45DDF210A4CFF88347B9C7D0B374A4CCE5161F3453DDA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C317B107DEF921CE79117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A596513FF0C11362E7B71BD85FD12544ACE77522F2DC490499D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342C0B628602DFD0BCB4E3FD7C086735B9E6C8161569CFD4BB9C21E56A9C2753C51A1D8F873123FA171D7E09C32AA3244C4B1DFC125D384463A4A85DC12E9EF7551DD47778AE04E04DFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojiysexgWf337t5JuIE3Cexw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB43FB31D02E4574538B60ED0C6BFB0748A5EDFEAEC55096412F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 20/30] test: adapt PUC Lua test for args in vararg func 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" Igor, Thanks for the review! On 31.03.21, Igor Munkin wrote: > Sergey, > > Thanks for the patch! I can't understand why this patch is separated > from the previous two (10 and 11). Could you provide a rationale for > this, please? Also consider the comments below. Answered about difference with 10th here [1]. I'm totally OK to squash it with 11th. > > On 26.03.21, Sergey Kaplun wrote: > > Lua 5.1 interprets ... in the vararg functions like additional first > > Typo: s/like additional/as an additional/. Fixed. > > > argument, unlike LuaJIT does. All extra arguments is set into `arg` > > Typo: s/arguments is set/arguments are set/. Fixed. > > > variable. > > > > Implicit `arg` parameter for old-style vararg functions was finally > > removed in Lua 5.2. This patch adjust tests in vararg.lua considering > > Minor: Did LuaJIT always respect such behaviour? If no, please mention > the commit where it has been changed. Yes, at least since LuaJIT-2.0.0-beta1, AFAICS. | $ src/luajit -v -e 'local function f(...) print(arg) end f(1, 3, 4)' | LuaJIT 2.0.0-beta1 -- Copyright (C) 2005-2009 Mike Pall. http://luajit.org/ | nil > > > Lua 5.2 test suite taken from > > https://www.lua.org/tests/lua-5.2.0-tests.tar.gz. > > > > Closes tarantool/tarantool#5712 > > As we discussed before: s/Closes/Resolves/. Fixed. > > > Part of tarantool/tarantool#5845 > > Part of tarantool/tarantool#4473 > > --- > > test/PUC-Lua-5.1-tests/vararg.lua | 16 ++++++++++++---- > > 1 file changed, 12 insertions(+), 4 deletions(-) > > > > diff --git a/test/PUC-Lua-5.1-tests/vararg.lua b/test/PUC-Lua-5.1-tests/vararg.lua > > index ae068fa..efb76c5 100644 > > --- a/test/PUC-Lua-5.1-tests/vararg.lua > > +++ b/test/PUC-Lua-5.1-tests/vararg.lua > > @@ -2,9 +2,13 @@ print('testing vararg') > > > > _G.arg = nil > > > > +-- Lua 5.1 interprets ... in the vararg functions like additional > > Typo: s/like additional/as an additional/. Fixed. > > > +-- first argument, unlike LuaJIT does. All extra arguments is set > > Typo: s/arguments is set/arguments are set/. Fixed. > > > +-- into `arg` variable. This extension is from Lua 5.2. > > +-- See also https://github.com/tarantool/tarantool/issues/5712. > > Side note: What is the difference between #5712 and #5694? They look > like duplicates to me, and so provide another rationale for squashing > all three patches into a single one. Answered about difference with 10th here [1]. Different tickets was created to be able "to eat mamonth by parts" -- to fix later not all, but single patch. I'm totally OK to squash it with 11th. > > > +-- LuaJIT: Test is adapted from PUC-Rio Lua 5.2 test suite. > > function f(a, ...) > > - assert(type(arg) == 'table') > > - assert(type(arg.n) == 'number') > > + local arg = {n = select('#', ...), ...} > > Why did you drop the assertions above? They are trivial (as many of > others in this suite), but still check that everything is fine (e.g. > that