From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (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 9243345BE2F for ; Fri, 29 May 2020 18:15:49 +0300 (MSK) From: sergeyb@tarantool.org Date: Fri, 29 May 2020 18:09:26 +0300 Message-Id: <91d3067bdea24ca0d8470d3b474f3c9d8d23679c.1590764168.git.sergeyb@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v6 17/25] Fix luacheck warnings in test/sql List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, imun@tarantool.org Cc: o.piskunov@tarantool.org, alexander.turenko@tarantool.org From: Sergey Bronnikov Part of #4681 Reviewed-by: Vladislav Shpilevoy Reviewed-by: Igor Munkin --- .luacheckrc | 2 +- test/sql/lua/sql_tokenizer.lua | 2 +- test/sql/savepoints.result | 6 +++--- test/sql/savepoints.test.lua | 6 +++--- test/sql/triggers.result | 2 +- test/sql/triggers.test.lua | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index f607732a9..97efdd8c7 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -12,7 +12,7 @@ exclude_files = { "test/engine_long/*.lua", "test/long_run-py/**/*.lua", "test/replication/*.test.lua", - "test/sql/*.lua", + "test/sql/*.test.lua", "test/swim/*.lua", "test/var/**/*.lua", "test/vinyl/*.lua", diff --git a/test/sql/lua/sql_tokenizer.lua b/test/sql/lua/sql_tokenizer.lua index 9922d792d..ffe4fb4e8 100644 --- a/test/sql/lua/sql_tokenizer.lua +++ b/test/sql/lua/sql_tokenizer.lua @@ -134,7 +134,7 @@ end -- @retval Token type. If the rest of the SQL request consists of -- spaces and comments, then return TK_EMPTY. local function get_next_token(context) - local c = '' + local c repeat local i = context.offset c = context.sql:sub(i, i) diff --git a/test/sql/savepoints.result b/test/sql/savepoints.result index 509c33e59..b0915f398 100644 --- a/test/sql/savepoints.result +++ b/test/sql/savepoints.result @@ -102,12 +102,12 @@ collision_sv_2 = function() box.begin() box.execute('SAVEPOINT t1;') box.execute('SAVEPOINT t2;') - local _,err = box.execute('SAVEPOINT t1;') + local _, err = box.execute('SAVEPOINT t1;') assert(err == nil) box.execute('RELEASE SAVEPOINT t1;') - local _,err = box.execute('RELEASE SAVEPOINT t1;') + _, err = box.execute('RELEASE SAVEPOINT t1;') assert(err ~= nil) - local _, err = box.execute('ROLLBACK TO t2;') + _, err = box.execute('ROLLBACK TO t2;') assert(err == nil) end; --- diff --git a/test/sql/savepoints.test.lua b/test/sql/savepoints.test.lua index f1b15c748..eb7bea37d 100644 --- a/test/sql/savepoints.test.lua +++ b/test/sql/savepoints.test.lua @@ -65,12 +65,12 @@ collision_sv_2 = function() box.begin() box.execute('SAVEPOINT t1;') box.execute('SAVEPOINT t2;') - local _,err = box.execute('SAVEPOINT t1;') + local _, err = box.execute('SAVEPOINT t1;') assert(err == nil) box.execute('RELEASE SAVEPOINT t1;') - local _,err = box.execute('RELEASE SAVEPOINT t1;') + _, err = box.execute('RELEASE SAVEPOINT t1;') assert(err ~= nil) - local _, err = box.execute('ROLLBACK TO t2;') + _, err = box.execute('ROLLBACK TO t2;') assert(err == nil) end; collision_sv_2(); diff --git a/test/sql/triggers.result b/test/sql/triggers.result index ceecb8ef2..e70d72947 100644 --- a/test/sql/triggers.result +++ b/test/sql/triggers.result @@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}}) --- ... -- Get invariant part of the tuple; name and opts don't change. - function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end + function immutable_part(data) local r = {} for _, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end --- ... -- diff --git a/test/sql/triggers.test.lua b/test/sql/triggers.test.lua index f5c8a3961..bc694ebc4 100644 --- a/test/sql/triggers.test.lua +++ b/test/sql/triggers.test.lua @@ -4,7 +4,7 @@ engine = test_run:get_cfg('engine') _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}}) -- Get invariant part of the tuple; name and opts don't change. - function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end + function immutable_part(data) local r = {} for _, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end -- -- gh-3273: Move Triggers to server -- 2.23.0