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 A92306EC5F; Tue, 2 Mar 2021 00:28:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A92306EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614634080; bh=4QYvyv4CFetIYH63F6xp7Rj41vOTO0ADEWMHDNbhnaQ=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=emt2GhqzVxjST4bhQq+0tKOynHNRjpwKG9U+4oaKOZ8tGl9uMcRv1SdJTayVoVqgx udhZtSbps0mjCtgQt0H+g9j1PMeCrquX7QZHKLG7A8q9hCWk+0zxYpgrG17WZaKIk6 R1LRxobA2d1F4oHVk/x7e8SNMFlqkSaLlMZHoFr0= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 C2D8D6BD03 for ; Tue, 2 Mar 2021 00:27:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C2D8D6BD03 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lGq4t-0005D5-49; Tue, 02 Mar 2021 00:27:43 +0300 To: Sergey Bronnikov , tarantool-patches@dev.tarantool.org References: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> <33adda25-ba4d-b50c-575e-9dd30b38488a@tarantool.org> <49412fc2-da26-dc44-0d40-2f73cbe46cf3@tarantool.org> Message-ID: <238f4e50-2884-a068-74f7-05fc70fe4a89@tarantool.org> Date: Mon, 1 Mar 2021 22:27:42 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <49412fc2-da26-dc44-0d40-2f73cbe46cf3@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92A98208ECBDD29F5BCF62610559114B730DD7337B29CB406182A05F538085040C9ED2626901E0E1231A6231319CD8DB14590CCB9F85089DF07510E898DB61FCF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7370F4F695FFFC24BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637352A1F9739ED04D38638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCF59B2E660736A58C7957B727A14B1F24A59DA0E7776B15C6389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6042F1592492B88C6CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC08F9A42B2210255C75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E7359E834CA16AA0C2CCC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F347543BADC64E7283B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A57C82B3D98D08EF1F599C7C842AFFE1791F0140155F609ADDD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AA13E2DDB90678623A8215FFCF5DC3B795F0F7A3ACC701BF7A9C1B385530F9A94935878E9CB7AE1B1D7E09C32AA3244CEE651E3556122B1B4C3BC65887E2A3EF5595C85A795C7BAE729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnpKwxR6GFbszjAPmz+GmyA== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822B522FB2E0B842AF6E0C3DEC445C29ECA3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 in test/sql-tap 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" > --- a/test/sql-tap/select9.test.lua > +++ b/test/sql-tap/select9.test.lua > @@ -274,8 +274,6 @@ test:do_execsql_test( >          -- >      }) > > -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] > -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >  --local function reverse(lhs, rhs) >  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) > >>       }) >>   -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >>   --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >> ==================== >> >> However even if we would would to keep them you wouldn't need `local _ = `. >> You can call functions without saving their result into a variable. > > luacheck reports an error when result of function is not assigned to variable. > > With patch: > > --- a/test/sql-tap/select9.test.lua > +++ b/test/sql-tap/select9.test.lua > @@ -274,8 +274,7 @@ test:do_execsql_test( >          -- >      }) > > -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] > -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] > +test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >  --local function reverse(lhs, rhs) >  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) > > it reports: > > Checking test/sql-tap/select9.test.lua            1 error > >     test/sql-tap/select9.test.lua:289:1: (E011) expected '=' near 'iOuterLoop' > > Total: 0 warnings / 1 error in 264 files > > > iOuterLoop is a variable on a next uncommented line. Seems Lua requires that function's result must be assigned to variable. That is hardly possible. We have Lua calls not saved into anything. For instance, grep fiber.name(...) calls. I suspect it is because you left ["id"] thing after the call. Because result of [] indeed makes no sense without being used.