[Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 in test/sql-tap
Sergey Bronnikov
sergeyb at tarantool.org
Mon Mar 1 16:26:08 MSK 2021
Hello!
On 28.02.2021 18:30, Vladislav Shpilevoy wrote:
> Hi again!
>
>> diff --git a/test/sql-tap/lua_sql.test.lua b/test/sql-tap/lua_sql.test.lua
>> index b22f195ca..0f6360dd4 100755
>> --- a/test/sql-tap/lua_sql.test.lua
>> +++ b/test/sql-tap/lua_sql.test.lua
>> @@ -102,9 +104,10 @@ box.schema.func.create('CHECK_FROM_LUA_TO_SQL', {language = 'Lua',
>> exports = {'LUA', 'SQL'}})
>>
>> -- check for different types
>> -for i = 1, #from_lua_to_sql, 1 do
>> +for i = 1, #from_lua_to_sql, 1 do -- luacheck: ignore from_lua_to_sql
>> test:do_execsql_test(
>> "lua_sql-2.3."..i,
>> + -- luacheck: ignore from_lua_to_sql
> Why do you need these ignores now?
Applied solution to `from_sql_to_lua` and missed that there is
`from_lua_to_sql`.
Fixed with patch below:
--- a/test/sql-tap/lua_sql.test.lua
+++ b/test/sql-tap/lua_sql.test.lua
@@ -84,7 +84,7 @@ for i = 1, #from_sql_to_lua, 1 do
{1})
end
-_G.from_lua_to_sql = {
+local from_lua_to_sql = {
[1] = {1, 1},
[2] = {"1.5", 1.5},
[3] = {"'1'", "1"},
@@ -93,6 +93,8 @@ _G.from_lua_to_sql = {
[6] = {12, 12LL},
}
+_G.from_lua_to_sql = from_lua_to_sql
+
box.schema.func.create('CHECK_FROM_LUA_TO_SQL', {language = 'Lua',
is_deterministic = true,
body = [[
@@ -104,10 +106,9 @@ box.schema.func.create('CHECK_FROM_LUA_TO_SQL',
{language = 'Lua',
exports = {'LUA', 'SQL'}})
-- check for different types
-for i = 1, #from_lua_to_sql, 1 do -- luacheck: ignore from_lua_to_sql
+for i = 1, #from_lua_to_sql, 1 do
test:do_execsql_test(
"lua_sql-2.3."..i,
- -- luacheck: ignore from_lua_to_sql
"select "..tostring(from_lua_to_sql[i][1]).." =
check_from_lua_to_sql("..i..")",
{true})
end
>
>> "select "..tostring(from_lua_to_sql[i][1]).." = check_from_lua_to_sql("..i..")",
>> {true})
>> end
More information about the Tarantool-patches
mailing list