[Tarantool-patches] [PATCH v7 3/3] luacheck: fix warnings in test/box-tap

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Mon Jan 11 20:52:51 MSK 2021


Thanks for the patch!

> diff --git a/.luacheckrc b/.luacheckrc
> index 52625bb35..b7f9abb45 100644
> --- a/.luacheckrc
> +++ b/.luacheckrc
> @@ -157,3 +156,23 @@ files["test/box/lua/fifo.lua"] = {
>  files["test/box/lua/identifier.lua"] = {
>       globals = {"run_test"}
>  }
> +files["test/box-tap/session.test.lua"] = {
> +    globals = {
> +        "active_connections",

This can be declared 'local'.

====================
@@ -70,6 +70,7 @@ session.on_disconnect(nil, fail)
 
 -- check how connect/disconnect triggers work
 local peer_name = "peer_name"
+local active_connections = 0
 local function inc() active_connections = active_connections + 1 end
 local function dec() active_connections = active_connections - 1 end
 local function peer() peer_name = box.session.peer() end
@@ -77,7 +78,6 @@ local net = { box = require('net.box') }
 test:is(type(session.on_connect(inc)), "function", "type of trigger inc on_connect")
 test:is(type(session.on_disconnect(dec)), "function", "type of trigger dec on_disconnect")
 test:is(type(session.on_disconnect(peer)), "function", "type of trigger peer on_disconnect")
-active_connections = 0
 local c = net.box.connect(HOST, PORT)
====================


More information about the Tarantool-patches mailing list