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 72DD985DED; Thu, 21 Jan 2021 15:54:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 72DD985DED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1611233658; bh=UHAaS1mQZt8JehRFC4UPWG8VsH1tVfhPDS3uEE5lnNA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gOZEoU3eOtsqWuc79V7ZQN3BFult/cKuW/SM9eAuOlX882KmUZaHBxjSDGW8MklYe xhDzxV4GhZuhgSk/FR3gOO0VxSnho9LpLxFGBm98a5suFfeIK/WegoRIyhv+xvcN3k A7CaEYhot7qA0iiqND7nYl5L1PCNH6ZrYOyYk25Y= 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 5C01A85DED for ; Thu, 21 Jan 2021 15:50:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C01A85DED Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1l2ZQJ-0007wD-7n; Thu, 21 Jan 2021 15:50:51 +0300 To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Date: Thu, 21 Jan 2021 15:50:07 +0300 Message-Id: <4c07d0c74a5a80d72c05328dd3196f5f062d8c51.1611232655.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9FAB20BF8F0759036F8D553AE972D0F0A4ECE5B46F21C4825182A05F53808504090DB2DD1372BE74ECCCA02CC1BF7CB5870E06CEC9C6591B860424A1024D5BC2F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE747D938A1F6F567D4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063700B087299B9BE63E8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCEB69F05919F51CB40DD588EDFB76CFB4255BBE1563C0F014389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0ECC8AC47CD0EDEFF8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B652D31B9D28593E51CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC6F009C1859321A3875ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4931B544F03EFBC4D57C2546860BDEA057BC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C2549B6A8B600A67A9D06752F40E6C338B98742EB6B604B0D9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF6EA1BA7CA28B4A74699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346840168BCAD8054E659A37792833F44A43F0F9EC770505CCCBEF344C1A9E6C5939049EA100CCF2521D7E09C32AA3244CB4F569587D6EB0CAA75C74D100596B344DBEAD0ED6C55A80927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojYT//mZRaUejsFcsjkLPvIQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382229217C02FABF65A3C8BFA4CE0C43A8C5DD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v8 08/14] test: fix luacheck warnings W311 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: Sergey Bronnikov via Tarantool-patches Reply-To: sergeyb@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Sergey Bronnikov W311 (Value assigned to a local variable is unused) Part of #5464 --- .luacheckrc | 2 -- test/sql-tap/analyze9.test.lua | 16 ++++++++-------- test/sql-tap/select9.test.lua | 3 +-- test/sql-tap/triggerA.test.lua | 1 - test/sql-tap/where2.test.lua | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index bfce2a6b4..31f9528ad 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -51,8 +51,6 @@ exclude_files = { files["test/sql-tap/**/*.lua"] = { ignore = { - -- "Value assigned to a local variable is unused." - "311", -- Unreachable code. "511", -- Loop can be executed at most once. diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua index 794bda379..7a24d6752 100755 --- a/test/sql-tap/analyze9.test.lua +++ b/test/sql-tap/analyze9.test.lua @@ -613,7 +613,7 @@ test:do_execsql_test( test:do_test( "10.1.2", function() - local a = 0 + local a for i = 1, 100 do if i > 90 then a = i @@ -661,7 +661,7 @@ test:do_execsql_test( test:do_test( "10.2.2", function() - local a = 0 + local a for i = 1, 100 do if i > 90 then a = i @@ -715,7 +715,7 @@ test:do_execsql_test( test:do_test( 11.1, function() - local a = 0 + local a for i = 0, 100 do if i % 10 == 0 then a = "\"ABC\"" @@ -766,7 +766,7 @@ test:do_execsql_test( test:do_test( 11.5, function() - local a = 0 + local a for i = 0, 100 do if i % 10 == 0 then a = "\"ABC\"" @@ -827,7 +827,7 @@ test:do_execsql_test( test:do_test( 12.1, function() - local a = 0 + local a for i = 0, 100 do if i % 10 == 0 then a = "\"ABC\"" @@ -878,7 +878,7 @@ test:do_execsql_test( test:do_test( 12.5, function() - local a = 0 + local a for i = 0, 100 do if i % 10 == 0 then a = "\"ABC\"" @@ -935,7 +935,7 @@ test:do_test( test:execsql("CREATE TABLE t1(id INTEGER PRIMARY KEY AUTOINCREMENT, a TEXT, b INT, c INT, d INT);") test:execsql("CREATE INDEX i1 ON t1(a);") test:execsql("CREATE INDEX i2 ON t1(b, c);") - local a = 0 + local a for i = 0, 100 do if i % 2 == 1 then a = "\"abc\"" @@ -1165,7 +1165,7 @@ test:do_test( INSERT INTO t1 SELECT null, 2*a,2*b,2*c,d FROM t1; INSERT INTO t1 SELECT null, 2*a,2*b,2*c,d FROM t1; ]]) - local b = 0 + local b for i = 0, 31 do if (i < 8) then b = 0 diff --git a/test/sql-tap/select9.test.lua b/test/sql-tap/select9.test.lua index 045d0e4c8..769f70069 100755 --- a/test/sql-tap/select9.test.lua +++ b/test/sql-tap/select9.test.lua @@ -60,10 +60,9 @@ local function subrange(t, first, last) end local function test_compound_select(testname, sql, result) - local nCol = 1 + local nCol local A = box.execute(sql) --test.box(sql) nCol = #A.metadata - A = A.rows local nRow = #result / nCol local compound_sql = sql test:do_execsql_test( diff --git a/test/sql-tap/triggerA.test.lua b/test/sql-tap/triggerA.test.lua index 6a801bda2..f0e11d627 100755 --- a/test/sql-tap/triggerA.test.lua +++ b/test/sql-tap/triggerA.test.lua @@ -45,7 +45,6 @@ test:do_test( INSERT INTO t1 VALUES(%d,'%s'); INSERT INTO t2 VALUES(20-%d,%d,'%s'); ]], i, word, i, j, word)) - i = i + 1 end return test:execsql [[ SELECT count(*) FROM t1 UNION ALL SELECT count(*) FROM t2; diff --git a/test/sql-tap/where2.test.lua b/test/sql-tap/where2.test.lua index 19611a05f..db7edd539 100755 --- a/test/sql-tap/where2.test.lua +++ b/test/sql-tap/where2.test.lua @@ -103,7 +103,7 @@ local function queryplan(sql) table.insert(data, tab) table.insert(data, idx) else - as, tab = string.match(v, "TABLE (%w+ AS) (%w+)") + local _, tab = string.match(v, "TABLE (%w+ AS) (%w+)") if tab == nil then tab = string.match(v, "TABLE (%w+)") end -- 2.25.1