[Tarantool-patches] [PATCH v6 14/25] Fix luacheck warnings in test/long_run-py

sergeyb at tarantool.org sergeyb at tarantool.org
Fri May 29 18:09:20 MSK 2020


From: Sergey Bronnikov <sergeyb at tarantool.org>

Part of #4681

Reviewed-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
Reviewed-by: Igor Munkin <imun at tarantool.org>

Co-authored-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
Co-authored-by: Igor Munkin <imun at tarantool.org>
---
 test/long_run-py/lua/finalizers.lua | 8 +++-----
 test/long_run-py/suite.lua          | 6 ++----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/test/long_run-py/lua/finalizers.lua b/test/long_run-py/lua/finalizers.lua
index 69146a323..cb6400363 100644
--- a/test/long_run-py/lua/finalizers.lua
+++ b/test/long_run-py/lua/finalizers.lua
@@ -1,19 +1,17 @@
 #!/usr/bin/env tarantool
 
-function on_gc(t)
+local function on_gc()
 end;
 
-function test_finalizers()
+local function test_finalizers()
     local result = {}
     local i = 1
     local ffi = require('ffi')
     while true do
-        result[i] = ffi.gc(ffi.cast('void *', 0), on_gc)
+        local result[i] = ffi.gc(ffi.cast('void *', 0), on_gc)
         i = i + 1
     end
-    return "done"
 end;
 
 test_finalizers()
 test_finalizers()
-
diff --git a/test/long_run-py/suite.lua b/test/long_run-py/suite.lua
index 0b33dec7d..c2ea97279 100644
--- a/test/long_run-py/suite.lua
+++ b/test/long_run-py/suite.lua
@@ -1,9 +1,9 @@
 
-function string_function()
+local function string_function()
     local random_number
     local random_string
     random_string = ""
-    for x = 1,20,1 do
+    for _ = 1,20,1 do
         random_number = math.random(65, 90)
         random_string = random_string .. string.char(random_number)
     end
@@ -11,7 +11,6 @@ function string_function()
 end
 
 function delete_replace_update(engine_name)
-    local string_value
     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then
         box.space.tester:drop()
     end
@@ -72,7 +71,6 @@ function delete_replace_update(engine_name)
 end
 
 function delete_insert(engine_name)
-    local string_value
     if (box.space._space.index.name:select{'tester'}[1] ~= nil) then
         box.space.tester:drop()
     end
-- 
2.23.0



More information about the Tarantool-patches mailing list