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 416BB21667F; Thu, 2 Mar 2023 18:43:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 416BB21667F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1677771833; bh=ikdJ/ZF4a7cTwx3DXuy6o75a/zE16vdKcg2EtUiDxGE=; 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=aT163MRy3urDAGnoX0hxeJEp86p+YUgZ/pY2TppUVIqyqdt/zZxnzvMpNcZXPvFys 5i9GRAfsQR02lHaQOVBf2v/4Iv/ghgBs+mJfBG9eisdMLGMQAkHBd3W03tjLAZYEYd u9iJ7/1SaAtn1L6UawNdP6A/sI4ttt3FeJETURD8= Received: from smtp17.i.mail.ru (smtp17.i.mail.ru [95.163.41.70]) (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 F34D621667F for ; Thu, 2 Mar 2023 18:43:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F34D621667F Received: by smtp17.i.mail.ru with esmtpa (envelope-from ) id 1pXl5z-00H2OL-0Y; Thu, 02 Mar 2023 18:43:51 +0300 Date: Thu, 2 Mar 2023 15:40:42 +0000 To: Maksim Kokryashkin Message-ID: References: <20230203124550.47694-1-max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230203124550.47694-1-max.kokryashkin@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9BCEC41593EBD83573B8B9DD5B75D52A38603AAE0EB1505CE182A05F538085040419DC8CF8C8682375855FBE577AD1C472A73590E41D86C433BC551BB082F55CB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73F300A97FDD4E158EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748E7A03516F25E8E8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8119B68394D205B4B68909503F57AC1D9117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC5613D04DEA810176A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520CCD848CCB6FE560CC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DE03CEA74F0D118906D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3AD74539164518AE59735652A29929C6CC4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637A7EFCB0EB5ACB161EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D7D5115130EFC8246806BC3F0A9DDE54F6D8456141818ED86202F2CE70CEAB97D6A095F875EDCF4A1D7E09C32AA3244C4316D00CA34D0D9375FB6CE04D39BD079CA7333006C390A083B48618A63566E0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojpNlqDWxrEBbLmWDjSySRyw== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531A5D8D644373BD3461F6E9B9981DE9C8B4F2814800C3B275D2326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] test: add test case for math.modf 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" Max, Thanks for the patch! LGTM, but there are some nits below. On 03.02.23, Maksim Kokryashkin via Tarantool-patches wrote: > Follows up commit 9b6c0cd8eafdd2e5a8a7ac4b33f6e33b3d8a93b9 > ("Don't compile math.modf() anymore."). > > This patch introduces the test case for the issue with > compiled `math.modf`, that was fixed by disabling the > compilation for it. > > Part of tarantool/tarantool#7230 Minor: It follows up the ticket, not a part of it. > --- > Branch: https://github.com/tarantool/luajit/tree/fckxorg/modf-test > PR: https://github.com/tarantool/tarantool/pull/8251 > > test/tarantool-tests/math-modf.test.lua | 31 +++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 test/tarantool-tests/math-modf.test.lua > > diff --git a/test/tarantool-tests/math-modf.test.lua b/test/tarantool-tests/math-modf.test.lua > new file mode 100644 > index 00000000..2aaa5189 > --- /dev/null > +++ b/test/tarantool-tests/math-modf.test.lua > @@ -0,0 +1,31 @@ > +local tap = require('tap') > +local test = tap.test('math-modf') > +test:plan(1) > + > +local function isnan(x) > + return x ~= x > +end > + > +local function array_is_consistent(res) > + for i = 1, #res - 1 do > + if res[i] ~= res[i + 1] and not (isnan(res[i]) and isnan(res[i + 1])) then > + return false > + end > + end > + return true > +end > + > +jit.opt.start('hotloop=1') > +jit.on() This line is excess. > + > +local modf = math.modf > +local inf = math.huge > + > +local r1 = {nil, nil, nil, nil} > +local r2 = {nil, nil, nil, nil} Minor: I'd rather use table.new here to make it clearer. > + > +for i = 1, 4 do > + r1[i], r2[i] = modf(inf) > +end > + > +test:ok(array_is_consistent(r1) and array_is_consistent(r2), 'wrong modf') > -- > 2.37.1 (Apple Git-137.1) > -- Best regards, IM