[Tarantool-patches] [PATCH v8 05/14] test: fix luacheck warnings W212 in test/sql-tap

sergeyb at tarantool.org sergeyb at tarantool.org
Thu Jan 21 15:50:01 MSK 2021


From: Sergey Bronnikov <sergeyb at tarantool.org>

W212 (Unused argument)

Part of #5464
---
 .luacheckrc                                 | 2 --
 test/sql-tap/e_expr.test.lua                | 4 ++--
 test/sql-tap/identifier-characters.test.lua | 2 +-
 test/sql-tap/lua/sqltester.lua              | 2 +-
 test/sql-tap/sort.test.lua                  | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index 9098d7112..c986b1cc2 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -51,8 +51,6 @@ exclude_files = {
 
 files["test/sql-tap/**/*.lua"] = {
     ignore = {
-        -- Unused argument.
-        "212",
         -- Unused loop variable.
         "213",
         -- Local variable is set but never accessed.
diff --git a/test/sql-tap/e_expr.test.lua b/test/sql-tap/e_expr.test.lua
index f29b26175..9947bbcd4 100755
--- a/test/sql-tap/e_expr.test.lua
+++ b/test/sql-tap/e_expr.test.lua
@@ -1077,7 +1077,7 @@ test:do_execsql_test(
 --
 -- MUST_WORK_TEST prepared statements
 if (0>0) then
-    local function parameter_test(tn, sql, params, result)
+    local function parameter_test(tn, sql, params, result) -- luacheck: no unused args
         local stmt = sql_prepare_v2("db", sql, -1)
         for _ in X(0, "X!foreach", [=[["number name",["params"]]]=]) do
             X(480, "X!cmd", [=[["do_test",[["tn"],".name.",["number"]],[["list","set","",["nm"]]],["name"]]]=])
@@ -1263,7 +1263,7 @@ test:do_execsql_test(
 test:execsql [[
     CREATE TABLE tblname(cname INT PRIMARY KEY);
 ]]
-local function glob(args)
+local function glob()
     return 1
 end
 
diff --git a/test/sql-tap/identifier-characters.test.lua b/test/sql-tap/identifier-characters.test.lua
index 7b257921d..184916bd3 100755
--- a/test/sql-tap/identifier-characters.test.lua
+++ b/test/sql-tap/identifier-characters.test.lua
@@ -65,7 +65,7 @@ local testcases = {
 		test:execsql("commit")
 		if ok == false then error(res) end
 	end,
-	function (id) end},
+	function () end},
 	{"trigger name",
 		function (id)
 			test:execsql(string.format([[
diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua
index 53d3c2514..af1c2476e 100644
--- a/test/sql-tap/lua/sqltester.lua
+++ b/test/sql-tap/lua/sqltester.lua
@@ -176,7 +176,7 @@ local function execsql(self, sql)
 end
 test.execsql = execsql
 
-local function catchsql(self, sql, expect)
+local function catchsql(self, sql)
     local r = {pcall(execsql, self, sql) }
     if r[1] == true then
         r[1] = 0
diff --git a/test/sql-tap/sort.test.lua b/test/sql-tap/sort.test.lua
index a11522741..bf56d0ac9 100755
--- a/test/sql-tap/sort.test.lua
+++ b/test/sql-tap/sort.test.lua
@@ -760,7 +760,7 @@ test:do_execsql_test(
 --
 -- MUST_WORK_TEST? special sql functions (sql_soft_heap_limit, sql_test_control...)
 if (0 > 0) then
-local function cksum(x)
+local function cksum()
     local i1 = 1
     local i2 = 2
     X(503, "X!cmd", [=[["binary","scan",["x"],"c*","L"]]=])
-- 
2.25.1



More information about the Tarantool-patches mailing list