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 0E5316F3C7; Fri, 26 Mar 2021 17:56:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0E5316F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616770594; bh=2SFfAZra8t5yoGWOxQy39TZAFlXyAewo1LQGbUuGb/A=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RVm7m5cEeriDJVd47NO7zAU2ZG7hVzHQH0DzO6Eo6GspzZrxFUg8L3tuZpQzOcszn wTb4AAnQ39xqNWDdzA20sqewOa4RSmm+ebm9ZcjmKhoH7MCxkfmWOhjHeusxiyq0P+ ZE2FSicq8NP2ghQEstPcD37NQBs9+xfQqXYztk+A= Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (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 634886F3C7 for ; Fri, 26 Mar 2021 17:56:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 634886F3C7 Received: by smtp16.mail.ru with esmtpa (envelope-from ) id 1lPnt2-0004n6-KL; Fri, 26 Mar 2021 17:56:32 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Fri, 26 Mar 2021 17:56:31 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <4F07E87B-7E67-4526-8962-1C6F0E590D94@tarantool.org> References: To: Sergey Kaplun X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32947287414FD1D04A09E656A5F3377C994A182A05F538085040EDB53A56BCE21866CB6F239F6F5C52FE798225B29210A9FD4E225855315C162C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7544B1CCE26E01C74EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371E8C7BD479B346ED8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5DEC34FBE6AF7101B6A047C8EA1B7C64DCA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7850F8B975A76562C9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C362968DCAA3E4B45B117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7352629B07FD02F83A6C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5FD2AC219A35891C1B3A600141AF3331EF8591F6C5762CE67D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343F22CE0A71FDB37E6C8C1AD21CA213942A6777AF5D241DD36D9C1F1017F5A5C8C507DF7379A023331D7E09C32AA3244C397E7C52637BE5BBF66C7090163AAA7924AF4FAF06DA24FDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAhUgI319vcFFQ== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81E2CF41B25E12BCC74CDFC82957A38BC98A4006E4682EE3538AD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 16/30] test: adapt PUC Lua test for %q in fmt for LuaJIT 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" LGTM. Sergos > On 26 Mar 2021, at 10:42, Sergey Kaplun wrote: >=20 > LuaJIT: LuaJIT since v2.0.0-beta6 has extension from Lua 5.2: > string.format(): %q reversible. > See also https://luajit.org/extensions.html#lua52. >=20 > In Lua 5.1 string.format() does not accept string values containing > embedded zeros, except as arguments to the '%q' option. > In Lua 5.2 '\0' is not handled differently from other > control chars in string.format('%q', ...). > See commit 7cc981c14067d4b0e774a6bfb0acfc2f5c911f0d > (string.format("%q", str) is now fully reversible > (from Lua 5.2).). >=20 > This patch adapts test for LuaJIT and Lua 5.2 behaviour considering > test from Lua 5.2 test suite taken from > https://www.lua.org/tests/lua-5.2.0-tests.tar.gz. >=20 > Closes tarantool/tarantool#5710 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/strings.lua | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/test/PUC-Lua-5.1-tests/strings.lua = b/test/PUC-Lua-5.1-tests/strings.lua > index 237dbad..7c1dfb8 100644 > --- a/test/PUC-Lua-5.1-tests/strings.lua > +++ b/test/PUC-Lua-5.1-tests/strings.lua > @@ -102,7 +102,17 @@ print('+') >=20 > x =3D '"=EF=BF=BDlo"\n\\' > assert(string.format('%q%s', x, x) =3D=3D = '"\\"=EF=BF=BDlo\\"\\\n\\\\""=EF=BF=BDlo"\n\\') > -assert(string.format('%q', "\0") =3D=3D [["\000"]]) > +-- LuaJIT: LuaJIT since v2.0.0-beta6 has extension from Lua 5.2: > +-- string.format(): %q reversible. > +-- In Lua 5.1 string.format() does not accept string values > +-- containing embedded zeros, except as arguments to the q option. > +-- In Lua 5.2 '\0' is not handled differently from other > +-- control chars in string.format('%q', ...). > +-- See commit 7cc981c14067d4b0e774a6bfb0acfc2f5c911f0d > +-- (string.format("%q", str) is now fully reversible > +-- (from Lua 5.2).). > +-- Test is adapted from PUC-Rio Lua 5.2 test suite. > +assert(string.format('%q', "\0") =3D=3D [["\0"]]) > assert(string.format("\0%c\0%c%x\0", string.byte("=EF=BF=BD"), = string.byte("b"), 140) =3D=3D > "\0=EF=BF=BD\0b8c\0") > assert(string.format('') =3D=3D "") > --=20 > 2.31.0 >=20