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 C5E506F3C7; Fri, 26 Mar 2021 10:49:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C5E506F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616744981; bh=Ox21uUU21Yt9B10PAj3aHvC1Yze+u1ZvnDmNj7zVosA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=F4wwjIv0J4yS0pZ0H/xzkGKJ44Qx1lnzaoMBl7Aq5ctYhhZZ8I3BQfidskjNxUovB exWKZTPi8MCEcG8dl4GIegFCuUPKFhS1DLu3Gr+pT9xxezeMQR7pM0mOZYOq73F3gf S/+dG99aEo9Z+X7qMKCIIr0lVY1yvB+Ey+dLkb10= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 0A4DC6AAB3 for ; Fri, 26 Mar 2021 10:44:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0A4DC6AAB3 Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1lPh8l-00042u-0W; Fri, 26 Mar 2021 10:44:19 +0300 To: Sergey Ostanevich , Igor Munkin Date: Fri, 26 Mar 2021 10:42:54 +0300 Message-Id: <0bf0dc418d1095fc5c8d3901469662c853fb93de.1616743343.git.skaplun@tarantool.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE9587C800CEAD38A69F042767B24605C2B182A05F53808504003167AB4FCA9F9FA461A6E76AB109199F9E8D3CD089F0DE5E2063CF805F68D78 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DECE8D0A5E25C0FCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377F497DA9C8A5F4D48638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5DABB613A1CDB6EA5F97B565BD71BAC1DFA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C37EF884183F8E4D67117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7351D6A3D1828C120DEC4224003CC83647689D4C264860C145E X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831181D79FD8B28A83567D7C3C64BB55547 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5DD32608FC869F5DABB613A1CDB6EA5F97B565BD71BAC1DF9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFF532FBFD8162E58C699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A150564C13026C1877D716681B1D19FB2C1B5D65D43229F17219D8E45FAE0F84C62C59AD3291A1021D7E09C32AA3244C7810D577142E4B276F36555D5730BE0EE646F07CC2D4F3D8927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAgRw+kMhSTdUg== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB480D5E0675FE784A2C37CE200D0FCECB71CEEFA1C7950CE11F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 luajit 11/30] test: adapt getlocal PUC test for vararg func 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Lua 5.1 interprets `...` in the vararg functions like an additional first argument unlike LuaJIT does. So, `a:f()` function will not set corresponding table `arg`, as test expects. Implicit `arg` parameter for old-style vararg functions was finally removed in Lua 5.2. The test is adapted from PUC-Rio Lua 5.2 test suite by removing additional check for amountt of arguments via `arg.n`. Lua 5.2 test suite is taken from https://www.lua.org/tests/lua-5.2.0-tests.tar.gz. Part of tarantool/tarantool#5845 Part of tarantool/tarantool#4473 --- test/PUC-Lua-5.1-tests/db.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/PUC-Lua-5.1-tests/db.lua b/test/PUC-Lua-5.1-tests/db.lua index e5d8885..6985c29 100644 --- a/test/PUC-Lua-5.1-tests/db.lua +++ b/test/PUC-Lua-5.1-tests/db.lua @@ -300,7 +300,16 @@ debug.sethook(function (e) end, "c") a:f(1,2,3,4,5) -assert(X.self == a and X.a == 1 and X.b == 2 and X.arg.n == 3 and X.c == nil) + +-- LuaJIT: Lua 5.1 interprets `...` in the vararg functions like +-- an additional first argument unlike LuaJIT does. +-- So, `a:f()` function will not set corresponding table `arg`, +-- as test expects. +-- Implicit `arg` parameter for old-style vararg functions was +-- finally removed in Lua 5.2 +-- The test is adapted from PUC-Rio Lua 5.2 test suite by removing +-- additional `arg.n == 3` check. +assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil) assert(XX == 12) assert(debug.gethook() == nil) -- 2.31.0