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 9100A595D81; Mon, 21 Aug 2023 14:03:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9100A595D81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692615814; bh=mrWsrS6/TKJebwqIdTE9wHDRRpn+bWxBruGCoSCM+k0=; 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=XSAttzU4+IKNgTWUFCr7olNlbmQHza6U8jT0IZb1ScyFOUWACT2Gu/p7DMhOB3+A8 oCRx0RGyVSsivHwpD7b4Dmm+w67Agaw3IvO84+lGaG27Rpgno/DVGQlruddcJwO9IV LRXyWz6fYlf0cGbdpA2aMPQI+xzrNheI2dxkXiQI= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (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 DD54C59417E for ; Mon, 21 Aug 2023 14:03:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DD54C59417E Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1qY2h0-00GkRJ-3D; Mon, 21 Aug 2023 14:03:31 +0300 Date: Mon, 21 Aug 2023 10:47:37 +0000 To: Sergey Bronnikov Message-ID: References: <28c7aec4df761b06208cc7ccd9055dd444ed2a70.1692089299.git.skaplun@tarantool.org> <29d67ed7-fed4-28ed-8dde-8030189008d6@tarantool.org> <1b754f01-34f8-d1a5-504a-fa825f555065@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1b754f01-34f8-d1a5-504a-fa825f555065@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD90D1D1AB54508998164C3387BA0FA5B81EA24825B1EA10A89182A05F5380850404C228DA9ACA6FE27412815C7B8B9FBDAE6EE5D7FF3C86B6A2FFAEA1EE14B323E3E788A65568A45B6 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE731D82F3F177D3BCDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF20B9B7F5DD35A68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D857E8B15ED1830534CB1336C76DE1BC18117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC6F8235414F7F731CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C67F1C1C3ABB44F3A03F1AB874ED890284AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C392AF71FE74A2456CBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7BEE702378D8A34C7731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5B582C0E732201F7D0448BF0DF8E8CD67D9D28241BCED210EF87CCE6106E1FC07E67D4AC08A07B9B06633242DC0339950CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3435BBF0AC4E3A921C75CD34B2D1BBF5B9EE9BC356BB89F88A5A0849C9A505EBB50EC4D3A0B21E2ED41D7E09C32AA3244C0433036B9F35AD32FBAA42CBDB4A67FE725D5B54B2FE4575ED9A463B7D0AAFF65DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojHJI2DMjVra1iqMAm0D9wjg== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531E0FF8D425433AEFA1C14AB5606000E46AF7FB42BDCBFC1972326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B 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: 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, > > > > 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). -- Best regards, IM