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 C41C76EC5D; Wed, 7 Apr 2021 00:37:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C41C76EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617745036; bh=jXRTIkh7aF0JoukyTtLg6hIH35WbqbVvZG/q1tPaO4k=; 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=mlmugxsYZG2L/wKbCF8pBwH4x3C1p2mUSLMhsKj68p6QYSR1wwGtQDuE4OTSuO33Y 0oK3ZJPhSp0cPhXGqzT1/DeSqq8RuIAWPeiooiD0Df67T3iR85NOWjotPKgLBVl/CD zJ6RCU1IHatGBOM1AsSB0QAIFbVjxV3FqlvrYgVE= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 26E936EC5D for ; Wed, 7 Apr 2021 00:37:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 26E936EC5D Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lTtNr-0001YQ-1m; Wed, 07 Apr 2021 00:37:15 +0300 Date: Wed, 7 Apr 2021 00:37:04 +0300 To: Sergey Kaplun Message-ID: <20210406213704.GL29703@tarantool.org> References: <20210330221631.GA29703@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD912A3E3D5D4B49FC1FEA0A53B931EDD909DE4D58F47F062C400894C459B0CD1B9DA92EC4C40313E9902FF1B915A2F84BABBABD01366BE3380C9EA2F84C7A79465 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B7733D0215A2F71AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637A85D247F7B1E5F958638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC1C8CC3B5DA0D001DD93F148119447090DEFFEC1D4B4FC198389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6957A4DEDD2346B42CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7BEA0E1DB66A6FB7C731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831C9B2EDF5B7A05C2CEEF3C316914408DE X-C1DE0DAB: 0D63561A33F958A5B15C7B6EAAFFB8D1E4BB9759B459CB1880E0913658627127D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D347D10A9FCB2A62DFEF0958036DC5951B967F93A4F4A07B95F3258CDDE9BAD5A67289CFF3D6DB9B6151D7E09C32AA3244C02C2049B9030F66D6C3302E3DF4A604B3E8609A02908F271927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojAX27rRizpLlrJuyXmghnMg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822DDAE7F43983430C9E253F449251A25D0A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Sergey, On 01.04.21, Sergey Kaplun wrote: > Igor, > > Thanks for the review! > > On 31.03.21, Igor Munkin wrote: > > Sergey, > > > > > > > string.format(): %q reversible. > > > See also https://luajit.org/extensions.html#lua52. > > > > > > 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).). > > > > Well, I honestly don't understand what is changed in *semantics*. I've > > tried the following command with Lua 5.2, Lua 5.1 and LuaJIT 2.0.5 as an > > interpreter being tested > > | -e 'print(string.format("%q", "\0"))' > > > > I understand the semantics of "%q", but was it just a bug in Lua 5.1? > > A bug with the test for it??? Well, I can remind you the bug with we fixed the last year. There might be no test for it though, but all in all it has not been fixed in Lua 5.1. > > > What does "fully reversible" mean in this context? This question is left unaddressed. > > > > I understand only the fact the behaviour differs and you reimplemented > > the test assertion according to Lua 5.2 testing suite. That's all. > > > > I found not a single word regarding this issue in Lua bugs[1] page, > > except invalid handling of \r[2]. Is there any issue/page with a more > > It looks unrelated to these changes. > > > verbose explanation what has been changed in 7cc981c? > > I just read these lines in Lua 5.1 reference manual :): > | This function does not accept string values containing embedded > | zeros, except as arguments to the q option. So what? This means literally nothing to me... BTW, I can pass such string to the function and it can yield any bullshit the developer wanted to. That's why we decided to comment such places in a clear and verbose way, didn't we? > > As for me, it is just new behaviour of Lua 5.2 -- patterns now accept > '\0' as a reqular character (see > 4541243355a299a9b75042d207feb87295872c3a (patterns now accept '\0' as a > regular character) from Lua repository). So, according to commit > 658ea8752b979102627e2fede7b7ddfbb67ba6c9 (no need to handle '\0' > differently from other control chars in format '%q')) from Lua > repository, this behaviour is excess. > > Also, it is mentioned here [2]. I see nothing regarding this change there. > > > > > [1]: https://www.lua.org/bugs.html#5.1 > > [2]: https://www.lua.org/bugs.html#5.1-4 > > > > -- > > Best regards, > > IM > > [1]: https://www.lua.org/manual/5.1/manual.html#pdf-string.format > [2]: https://www.lua.org/manual/5.2/manual.html#8.2 > > -- > Best regards, > Sergey Kaplun -- Best regards, IM