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 15DD55B2C7F; Thu, 24 Aug 2023 10:45:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 15DD55B2C7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692863101; bh=KTsoARAWci7SNk1mdcbCtE80A5za81yG3EVvi9yvWi4=; 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=xGNGeWwxsJGQ2g085aiwi4UdCQYnqPZdI2Y6z5xG/qib5r5vClHGvoJ8gKLzEaJ/G l6bmYmVnrWQk6ms0wfExK+fIQxVFFbWJDbUwEtagBHLkDDLkl0jbYmH8sGp4cuWaMu sfgFkLzmx1oRAJE2Vq79cVvUssITIDqwleBjkljs= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 E063B4DE981 for ; Thu, 24 Aug 2023 10:44:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E063B4DE981 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1qZ51X-006LnL-0H; Thu, 24 Aug 2023 10:44:59 +0300 Message-ID: <8fb09570-4795-5412-86bd-487749e93101@tarantool.org> Date: Thu, 24 Aug 2023 10:44:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Igor Munkin References: <28c7aec4df761b06208cc7ccd9055dd444ed2a70.1692089299.git.skaplun@tarantool.org> <29d67ed7-fed4-28ed-8dde-8030189008d6@tarantool.org> <1b754f01-34f8-d1a5-504a-fa825f555065@tarantool.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD93C8852532D76B9E33924516A452DEC2A3E90962AAB48A6A6182A05F538085040273CAD514F590DE459DCBA6FD401F1DE57DE4008DF20FD6991627C5E9D949617 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77633BACAB33B9508C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE76D4A2B7BAC4DEDB8EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BE5CCB53A13BC8DBA8C743D79FA065142D8BD27325F1B228FCC7F00164DA146DAFE8445B8C89999728AA50765F790063757608A5A3F2C1CD88941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B601F8F2FECC0250C8CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22493C27ABBBEF6DEBF976E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8BE7750D0FF1BFD8A13AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735B7122A4C44A4E42FC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5F4F69604712F69B3B57C1B7A34C5638564A5F1BB1F066830F87CCE6106E1FC07E67D4AC08A07B9B0D56D36E97F3F038CCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D346BEB6F73FB9D1E4A8010782C7356F6C39B74E7AEADAFD200C41F7F855B293E6348DA19149AD19D601D7E09C32AA3244C07CC4C0F43256534F09DFFA7BE5F22B83A92A9747B6CC886BAD658CF5C8AB4025DA084F8E80FEBD3FFA33E6B6B2F82C47A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbN4zljfpmjFIFQYMSCPq3w== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76937470BA384C2FABB59DCBA6FD401F1DE228AB1844EA588C7EBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/5] test: introduce `samevalues()` TAP checker 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" H, Igor, Sergey On 8/21/23 13:47, Igor Munkin wrote: > Sergey, > > > >>>>> The introduced `samevalues()` helper checks that values in range from >>>>> 1, to `table.maxn()` of the given table are exactly the same. It may be >>>>> usefull for test consistency of JIT and VM behaviour. Originally, the >>>>> `arr_is_consistent()` function was introduced in the >>>>> . `samevalues()` has the same >>>>> functionallity (except usage of `table.maxn()` instead `#` operator to >>>>> be sure, that the table we check isn't a sparse array). >>>> I would rename samevalues to something like assert_equals or >>>> assert_items_equals just because >>>> >>>> similar functions are named in unit testing frameworks and helpers with >>>> prefix assert_ >>> As you can see we use naming without _ for exported function in the >>> module, so additional one with strange naming will be >>> inconsistent. >>> >>> Also, discussed this naming with Igor and Max offline and this name is >>> OK for them, feel free also to CC Igor to discuss:). >>> >>>> more readable from my point of view. See names for assertions in luatest >>>> [1] and JUnit (popular unit testing framework). >>>> >>>> >>>> 1. https://github.com/tarantool/luatest#list-of-luatest-functions >>>> >>>> 2. >>>> https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html >>>> >>>> >> Igor, what do you think regarding naming of the introduced function? > Frankly speaking, it was me, who originally suggested this name (AFAIR, > but Sergey K. might correct me if I'm wrong), so I'm totally fine with > the naming and here why: > 1. There are no functions named in the style you're referring to above. > This may relate to luatest, but definitely not to our version of > tap.lua module. > 2. All the names *except* for some historical reasons (and > due to many Python lovers, that worked in Tarantool, I guess) are > named in so-called "Lua-way" (you can see many examples in Lua > Reference Manual or in popular Lua modules): short name with in lower > case with no separators like underscore or other. This applies to > too. > 3. As for me should validate all the items in > table against the one *expected*, however just checks > that the table consists of the same values, but nobody has to know > this particular value. > > All in all, I'm OK with the current name, since it fits to the current > naming policy. However, I'm open to other options regarding the > assertion module to be used in our testing suite (of course, out of the > scope of this series). > Igor, thanks for detailed explanation. Arguments looks reasonable for me. I just wanted to make sure that the choice is not accidental and made spontaneously. Sergey, LGTM now.