[Tarantool-patches] [PATCH v7 2/3] luacheck: fix warnings in test/app

Sergey Bronnikov sergeyb at tarantool.org
Mon Dec 21 14:00:34 MSK 2020


Hi! Thanks for review!

On 20.12.2020 16:59, Vladislav Shpilevoy wrote:
> Thanks for the patch!
>
>> diff --git a/.luacheckrc b/.luacheckrc
>> index ae96576ec..d9093a5eb 100644
>> --- a/.luacheckrc
>> +++ b/.luacheckrc
>> @@ -109,3 +109,6 @@ files["test/app-tap/lua/require_mod.lua"] = {
>>   files["test/app-tap/string.test.lua"] = {
>>       globals = {"utf8"}
>>   }
>> +files["test/app/lua/fiber.lua"] = {
>> +    globals = {"box_fiber_run_test"}
>> +}
> fiber.lua is used in one place, where it can be properly fixed
> instead of ignored. fiber.lua can 'return box_fiber_run_test' in
> the end instead of passing this function as a global variable.
Fixed in a branch and force-pushed.

--- a/test/app/fiber.result
+++ b/test/app/fiber.result
@@ -560,11 +560,11 @@ space:drop()
  ---
  ...
  -- box.fiber test (create, resume, yield, status)
-dofile("fiber.lua")
+f = dofile("fiber.lua")
  ---
  ...
  -- print run fiber's test
-box_fiber_run_test()
+f()
  ---
  - - 'A: odd  1'
    - 'tester: status(printer) = suspended'

--- a/test/app/fiber.test.lua
+++ b/test/app/fiber.test.lua
@@ -215,9 +215,9 @@ fiber.self():name(old_name)
  space:drop()

  -- box.fiber test (create, resume, yield, status)
-dofile("fiber.lua")
+f = dofile("fiber.lua")
  -- print run fiber's test
-box_fiber_run_test()
+f()
  -- various...
  function testfun() while true do fiber.sleep(10) end end
  f = fiber.create(testfun)
diff --git a/test/app/lua/fiber.lua b/test/app/lua/fiber.lua
index 64977623e..301b0f098 100644
--- a/test/app/lua/fiber.lua
+++ b/test/app/lua/fiber.lua
@@ -78,3 +78,5 @@ function box_fiber_run_test()
      end
         return result
  end
+
+return box_fiber_run_test




More information about the Tarantool-patches mailing list