Skip to content

Commit

Permalink
test: fix luacheck warnings W542 in test/sql-tap
Browse files Browse the repository at this point in the history
W542 (An empty if branch)

Part of #5464

(cherry picked from commit 8f3b9b4)
  • Loading branch information
ligurio authored and kyukhin committed Mar 2, 2021
1 parent 0f45c7a commit bf9e486
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .luacheckrc
Expand Up @@ -49,8 +49,6 @@ exclude_files = {

files["test/sql-tap/**/*.lua"] = {
ignore = {
-- An empty if branch.
"542",
-- A line consists of nothing but whitespace.
"611",
-- A line contains trailing whitespace.
Expand Down
6 changes: 0 additions & 6 deletions test/sql-tap/selectA.test.lua
Expand Up @@ -76,9 +76,6 @@ test:do_execsql_test(
})

-- MUST_WORK_TEST
if (0 > 0)
then
end
test:do_execsql_test(
"selectA-2.1",
[[
Expand Down Expand Up @@ -2354,9 +2351,6 @@ test:do_execsql_test(
--
-- MUST_WORK_TEST
-- TODO stored procedures are not supported by now
if (0 > 0)
then
end
local function f(args) -- luacheck: no unused
return 1
end
Expand Down
2 changes: 2 additions & 0 deletions test/sql-tap/selectB.test.lua
Expand Up @@ -212,6 +212,7 @@ test:do_execsql_test(

for ii = 3, 6, 1 do
if ii == 4 then
assert(ii == 4) -- added to pass luacheck
-- TODO
--X(2, "X!cmd", [=[["optimization_control","db","query-flattener","off"]]=])
elseif ii == 5 then
Expand All @@ -232,6 +233,7 @@ for ii = 3, 6, 1 do
})

elseif ii == 6 then
assert(ii == 6) -- added to pass luacheck
--X(2, "X!cmd", [=[["optimization_control","db","query-flattener","off"]]=])
end
test:do_execsql_test(
Expand Down
3 changes: 0 additions & 3 deletions test/sql-tap/tkt-91e2e8ba6f.test.lua
Expand Up @@ -81,9 +81,6 @@ test:do_execsql_test(
})

-- MUST_WORK_TEST
if (0 > 0)
then
end
test:do_execsql_test(
1.7,
[[
Expand Down
3 changes: 0 additions & 3 deletions test/sql-tap/tkt-9a8b09f8e6.test.lua
Expand Up @@ -21,9 +21,6 @@ test:plan(47)
-- ["set","testdir",[["file","dirname",["argv0"]]]]
-- ["source",[["testdir"],"\/tester.tcl"]]
-- MUST_WORK_TEST
if (0 > 0)
then
end
test:do_execsql_test(
1.1,
[[
Expand Down
3 changes: 0 additions & 3 deletions test/sql-tap/tkt3493.test.lua
Expand Up @@ -255,9 +255,6 @@ test:do_execsql_test(
})

-- MUST_WORK_TEST
if (0 > 0)
then
end
test:do_execsql_test(
"tkt3493-3.2.1",
[[
Expand Down
1 change: 1 addition & 0 deletions test/sql-tap/with1.test.lua
Expand Up @@ -631,6 +631,7 @@ local function limit_test(tn, iLimit, iOffset)
end
-- if X(0, "X!expr01", [["$iLimit < 0 "]]) then
if iLimit < 0 then
assert(iLimit < 0) -- added to pass luacheck
-- result = X(467, "X!cmd", [=[["lrange",["::I"],["iOffset"],"end"]]=])
-- last is 20
else
Expand Down

0 comments on commit bf9e486

Please sign in to comment.