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 E44A4313976; Thu, 2 Mar 2023 15:31:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E44A4313976 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1677760308; bh=mJ/vwO/I9vlDGV1f6Oq2sHdtz2UPBzvUYCmpKnGpA9I=; 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=VVIb84cW6P9pmK8BF9bDYi6+kbbsGZt27A8whIaPYktgQI/t3Y1LKHfsUu4Mzy7ps dB9WaOQmJ1NKZy77fz8Y3kGrERcVjc1PvQEoQv7aJGhQgtggNTgwxFIv/m/2g+P/SX Dger++Rw9FCVk1GTnwW+3cW8xzIV4vpNVqFAUI6M= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (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 045F221667F for ; Thu, 2 Mar 2023 15:31:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 045F221667F Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1pXi65-006UFl-Ah; Thu, 02 Mar 2023 15:31:45 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) In-Reply-To: <20230203124550.47694-1-max.kokryashkin@gmail.com> Date: Thu, 2 Mar 2023 15:31:34 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20230203124550.47694-1-max.kokryashkin@gmail.com> To: Maksim Kokryashkin X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Mailru-Src: smtp X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9CCAB0EF48C080D70AFC106C0FFBC86DF1C928D65D1B6CDD4182A05F538085040506B477FA5921426FF7574C9C8EF7F5DFB293281431EFB5374E555B9EF0CBE17 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3483E1FCD56FEA62E6C006AEDD7A27698C4E2CA8C5B87F94E690E65D26FBC406700B66D4ED562EFE341D7E09C32AA3244C48CDDE8262A670D3FE58C31246D4F8AEC86C126E7119A0FE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojpNlqDWxrEBbbq/6tJ3sWbQ== X-Mailru-Sender: 11C2EC085EDE56FA38FD4C59F7EFE407BE17C65B6CFA1DAA7813FA2AB35962D3B4C484181976E6BC19381EE24192DF5555834048F03EF5D4C9A814A92B2E3B1BA4250FC3964EA4964198E0F3ECE9B5443453F38A29522196 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: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch, LGTM. Sergos > On 3 Feb 2023, at 15:45, Maksim Kokryashkin = wrote: >=20 > Follows up commit 9b6c0cd8eafdd2e5a8a7ac4b33f6e33b3d8a93b9 > ("Don't compile math.modf() anymore."). >=20 > This patch introduces the test case for the issue with > compiled `math.modf`, that was fixed by disabling the > compilation for it. >=20 > Part of tarantool/tarantool#7230 > --- > Branch: https://github.com/tarantool/luajit/tree/fckxorg/modf-test > PR: https://github.com/tarantool/tarantool/pull/8251 >=20 > test/tarantool-tests/math-modf.test.lua | 31 +++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 test/tarantool-tests/math-modf.test.lua >=20 > 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 =3D require('tap') > +local test =3D tap.test('math-modf') > +test:plan(1) > + > +local function isnan(x) > + return x ~=3D x > +end > + > +local function array_is_consistent(res) > + for i =3D 1, #res - 1 do > + if res[i] ~=3D 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=3D1') > +jit.on() > + > +local modf =3D math.modf > +local inf =3D math.huge > + > +local r1 =3D {nil, nil, nil, nil} > +local r2 =3D {nil, nil, nil, nil} > + > +for i =3D 1, 4 do > + r1[i], r2[i] =3D modf(inf) > +end > + > +test:ok(array_is_consistent(r1) and array_is_consistent(r2), 'wrong = modf') > -- > 2.37.1 (Apple Git-137.1) >=20