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 11F186F3C7; Fri, 26 Mar 2021 14:23:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 11F186F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616757782; bh=nqCZhhsNLHSi2ED/F4n5O/k8GJEHWc1lWy1WxU6GJHo=; h=Date:In-Reply-To:To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=q+lLJ9UqRYAS9NrddIzGAnirIhwpKmleYJX9sJ6XNpI4MtbV2iAFdbZ1zMvorliVi FfVCUJSgjV8URWoWNBiW02yBXeSn0n9eemyytDAH9NbuJRAJEopKisVYrtNZuLp4hG W4g4cQ3d6aEz3/4YJspW/4ij3F9uZTVTHXCi0zpE= Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (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 757DE6F3C7 for ; Fri, 26 Mar 2021 14:23:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 757DE6F3C7 Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1lPkYN-0001oQ-HQ; Fri, 26 Mar 2021 14:22:59 +0300 Message-Id: <93B80F76-89E1-4459-B39D-4A9212B1C63A@tarantool.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_896A89DC-2A97-476A-9B27-5549DC615B0D" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Date: Fri, 26 Mar 2021 14:22:58 +0300 In-Reply-To: <4a8669339a59964c0b187263f864692946d51303.1616743343.git.skaplun@tarantool.org> To: Sergey Kaplun References: <4a8669339a59964c0b187263f864692946d51303.1616743343.git.skaplun@tarantool.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE954173BE606B1EB548800CB16E8E806CE182A05F5380850406E4EC599D9DFC025E4C05CEFAAC33019A95D72AC131A5BB05AA6CC86A218516D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7544B1CCE26E01C74EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BB46061768088B55EA1F7E6F0F101C67CDEEF6D7F21E0D1D174C73DBBBFC7664DC1964D542DDDD831947381D6D18247D97E6262CFBECB066389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D082881546D93491CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CFC5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E625242539A7722CA490CB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5F22612E8B5DD664EBDD512BD6CA6BAE159905AC780837374D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F1257DC9690AEBA14717912C52FFAD591F72A7AC310A9951AFC2ABA5034AD019A11521D40FE503EE1D7E09C32AA3244C44CB597DF5945A58A481BB793F05A4E03FD9C8CA1B0515E0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAj5eUyo7zFKuw== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E8564AF5D8C7EBB848FA59B5855793A43BC636905420AD8ABAD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 05/30] test: adapt arg availability test from Lua suite 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 Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" --Apple-Mail=_896A89DC-2A97-476A-9B27-5549DC615B0D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 LGTM. Although, I can=E2=80=99t support the `s =3D string.gsub(s, "lua", = progname, 1)` technique.=20 Sergos > On 26 Mar 2021, at 10:42, Sergey Kaplun wrote: >=20 > The argument table `arg` can be read (and modified) by `LUA_INIT` and > `-e` chunks since the commit 92d9ff211ae864777a8580b5a7326d5f408161ce > (Set arg table before evaluating LUA_INIT and -e chunks.). >=20 > This behaviour is similar to Lua 5.3, so the test was adapted > considering PUC-Rio Lua 5.3 test suite taken from > https://www.lua.org/tests/lua-5.3.0-tests.tar.gz. >=20 > Closes tarantool/tarantool#5686 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/main.lua | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/test/PUC-Lua-5.1-tests/main.lua = b/test/PUC-Lua-5.1-tests/main.lua > index 4f8b8bf..c11a576 100644 > --- a/test/PUC-Lua-5.1-tests/main.lua > +++ b/test/PUC-Lua-5.1-tests/main.lua > @@ -69,9 +69,19 @@ a =3D string.format(a, progname) > prepfile(a) > RUN('lua "-e " -- %s a b c', prog) >=20 > -prepfile"assert(arg=3D=3Dnil)" > +-- test 'arg' availability in libraries > +-- LuaJIT: LuaJIT v2.1.0-beta3 has extension from Lua 5.3: > +-- The argument table `arg` can be read (and modified) > +-- by `LUA_INIT` and `-e` chunks. > +-- See commit 92d9ff211ae864777a8580b5a7326d5f408161ce > +-- (Set arg table before evaluating LUA_INIT and -e chunks.). > +-- See also https://github.com/tarantool/tarantool/issues/5686. > +-- In Lua 5.3 this feature was introduced via commit > +-- 23f0ff95177eda2e0a80e3a48562cc6837705735. > +-- Test is adapted from PUC-Rio Lua 5.3 test suite. > +prepfile"assert(arg)" > prepfile("assert(arg)", otherprog) > -RUN("lua -l%s - < %s", prog, otherprog) > +RUN('env LUA_PATH=3D"?;;" lua -l%s - < %s', prog, otherprog) >=20 > prepfile"" > RUN("lua - < %s > %s", prog, out) > --=20 > 2.31.0 >=20 --Apple-Mail=_896A89DC-2A97-476A-9B27-5549DC615B0D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 LGTM.

Although, I can=E2=80=99t support the `s = =3D = string.gsub(s, "lua", progname, 1)`
technique. 

Sergos

On 26 = Mar 2021, at 10:42, Sergey Kaplun <skaplun@tarantool.org> wrote:

The = argument table `arg` can be read (and modified) by `LUA_INIT` and
`-e` chunks since the commit = 92d9ff211ae864777a8580b5a7326d5f408161ce
(Set arg table = before evaluating LUA_INIT and -e chunks.).

This behaviour is similar to Lua 5.3, so the test was = adapted
considering PUC-Rio Lua 5.3 test suite taken = from
https://www.lua.org/tests/lua-5.3.0-tests.tar.gz.

Closes tarantool/tarantool#5686
Part of tarantool/tarantool#5845
Part of = tarantool/tarantool#4473
---
= test/PUC-Lua-5.1-tests/main.lua | 14 ++++++++++++--
1 = file changed, 12 insertions(+), 2 deletions(-)

diff --git a/test/PUC-Lua-5.1-tests/main.lua = b/test/PUC-Lua-5.1-tests/main.lua
index 4f8b8bf..c11a576 = 100644
--- a/test/PUC-Lua-5.1-tests/main.lua
+++ b/test/PUC-Lua-5.1-tests/main.lua
@@ -69,9 = +69,19 @@ a =3D string.format(a, progname)
prepfile(a)
RUN('lua "-e " -- %s a b c', prog)

-prepfile"assert(arg=3D=3Dnil)"
+-- test 'arg' = availability in libraries
+-- LuaJIT: LuaJIT v2.1.0-beta3 = has extension from Lua 5.3:
+-- The argument table `arg` = can be read (and modified)
+-- by `LUA_INIT` and `-e` = chunks.
+-- See commit = 92d9ff211ae864777a8580b5a7326d5f408161ce
+-- (Set arg = table before evaluating LUA_INIT and -e chunks.).
+-- See = also https://github.com/tarantool/tarantool/issues/5686.
+-- In Lua 5.3 this feature was introduced via commit
+-- 23f0ff95177eda2e0a80e3a48562cc6837705735.
+--= Test is adapted from PUC-Rio Lua 5.3 test suite.
+prepfile"assert(arg)"
prepfile("assert(arg)", = otherprog)
-RUN("lua -l%s - < %s", prog, otherprog)
+RUN('env LUA_PATH=3D"?;;" lua -l%s - < %s', prog, = otherprog)

prepfile""
= RUN("lua - < %s > %s", prog, out)
--
2.31.0


= --Apple-Mail=_896A89DC-2A97-476A-9B27-5549DC615B0D--