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

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


From: Sergey Bronnikov <sergeyb at tarantool.org>

W511 (Unreachable code)

Part of #5464
---
 .luacheckrc                          | 2 --
 test/sql-tap/date.test.lua           | 3 ++-
 test/sql-tap/select1.test.lua        | 3 ++-
 test/sql-tap/table.test.lua          | 3 ++-
 test/sql-tap/tkt-bd484a090c.test.lua | 3 ++-
 test/sql-tap/tkt2192.test.lua        | 3 ++-
 6 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index 31f9528ad..88fc34fa4 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -51,8 +51,6 @@ exclude_files = {
 
 files["test/sql-tap/**/*.lua"] = {
     ignore = {
-        -- Unreachable code.
-        "511",
         -- Loop can be executed at most once.
         "512",
         -- An empty if branch.
diff --git a/test/sql-tap/date.test.lua b/test/sql-tap/date.test.lua
index fe5150719..0b37d52f8 100755
--- a/test/sql-tap/date.test.lua
+++ b/test/sql-tap/date.test.lua
@@ -29,7 +29,8 @@ test:plan(0)
 
 -- Disabled until #3694 is resolved.
 --
-if false then
+local is_gh_3694_closed = false
+if is_gh_3694_closed then
 local function datetest(tnum, expr, result)
     test:do_test(
         "date-"..tnum,
diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua
index d1301e5ad..2f61ae0ec 100755
--- a/test/sql-tap/select1.test.lua
+++ b/test/sql-tap/select1.test.lua
@@ -1513,7 +1513,8 @@ test:do_execsql_test(
 -- TODO: This test is failing because f1 is now being loaded off the
 -- disk as a vdbe integer, not a string. Hence the value of f1/(f1-11)
 -- changes because of rounding. Disable the test for now.
-if false
+local is_gh_5737_closed = false
+if is_gh_5737_closed
  then
     test:do_execsql_test(
         "select1-8.4",
diff --git a/test/sql-tap/table.test.lua b/test/sql-tap/table.test.lua
index 2817e1e72..bb36d994e 100755
--- a/test/sql-tap/table.test.lua
+++ b/test/sql-tap/table.test.lua
@@ -945,7 +945,8 @@ test:do_execsql_test(
 --
 --  Disabled until #3694 is resolved.
 --
-if false then
+local is_gh_3694_closed = false
+if is_gh_3694_closed then
 test:do_execsql_test(
     "table-13.1",
     [[
diff --git a/test/sql-tap/tkt-bd484a090c.test.lua b/test/sql-tap/tkt-bd484a090c.test.lua
index 6187fee7f..6cd219722 100755
--- a/test/sql-tap/tkt-bd484a090c.test.lua
+++ b/test/sql-tap/tkt-bd484a090c.test.lua
@@ -21,7 +21,8 @@ test:plan(0)
 
 -- Disabled until #3694 is resolved.
 --
-if false then
+local is_gh_3694_closed = false
+if is_gh_3694_closed then
 test:do_test(
     1.1,
     function()
diff --git a/test/sql-tap/tkt2192.test.lua b/test/sql-tap/tkt2192.test.lua
index dabdfd141..74ec19a63 100755
--- a/test/sql-tap/tkt2192.test.lua
+++ b/test/sql-tap/tkt2192.test.lua
@@ -26,7 +26,8 @@ test:plan(4)
 
 --  Disabled until #3694 is resolved.
 --
-if false then
+local is_gh_3694_closed = false
+if is_gh_3694_closed then
 test:do_execsql_test(
     "tkt2192-1.1",
     [[
-- 
2.25.1



More information about the Tarantool-patches mailing list