mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
unittests/*/helpers: Fix testlint errors
This commit is contained in:
parent
7900e38a8f
commit
142d00e8da
@ -45,7 +45,7 @@ local obj2lua_tab = {
|
||||
return true
|
||||
end
|
||||
end,
|
||||
[tonumber(api.kObjectTypeNil)] = function(obj)
|
||||
[tonumber(api.kObjectTypeNil)] = function(_)
|
||||
return nil_value
|
||||
end,
|
||||
[tonumber(api.kObjectTypeFloat)] = function(obj)
|
||||
@ -60,8 +60,8 @@ local obj2lua_tab = {
|
||||
}
|
||||
|
||||
obj2lua = function(obj)
|
||||
return ((obj2lua_tab[tonumber(obj['type'])] or function(obj)
|
||||
assert(false, 'Converting ' .. tostring(tonumber(obj['type'])) .. ' is not implementing yet')
|
||||
return ((obj2lua_tab[tonumber(obj['type'])] or function(obj_inner)
|
||||
assert(false, 'Converting ' .. tostring(tonumber(obj_inner['type'])) .. ' is not implementing yet')
|
||||
end)(obj))
|
||||
end
|
||||
|
||||
@ -70,6 +70,8 @@ local obj = function(typ, data)
|
||||
api.api_free_object)
|
||||
end
|
||||
|
||||
local lua2obj
|
||||
|
||||
local lua2obj_type_tab = {
|
||||
[int_type] = function(l)
|
||||
return obj(api.kObjectTypeInteger, {integer=l.value})
|
||||
@ -104,7 +106,7 @@ local lua2obj_type_tab = {
|
||||
api.xmalloc(len * ffi.sizeof('KeyValuePair'))),
|
||||
}})
|
||||
for i = 1, len do
|
||||
local key, value = table.unpack(kvs[i])
|
||||
local key, val = table.unpack(kvs[i])
|
||||
dct.data.dictionary.items[i - 1] = ffi.new(
|
||||
'KeyValuePair', {key=ffi.gc(lua2obj(key), nil).data.string,
|
||||
value=ffi.gc(lua2obj(val), nil)})
|
||||
@ -131,7 +133,7 @@ lua2obj = function(l)
|
||||
elseif type(l) == 'string' then
|
||||
return obj(api.kObjectTypeString, {string={
|
||||
size=#l,
|
||||
data=eval.xmemdupz(to_cstr(l), #l),
|
||||
data=api.xmemdupz(to_cstr(l), #l),
|
||||
}})
|
||||
elseif l == nil or l == nil_value then
|
||||
return obj(api.kObjectTypeNil, {integer=0})
|
||||
|
@ -52,7 +52,9 @@ local special_tab = {
|
||||
local lst2tbl
|
||||
local dct2tbl
|
||||
|
||||
local typvalt2lua_tab = {
|
||||
local typvalt2lua_tab
|
||||
|
||||
typvalt2lua_tab = {
|
||||
[tonumber(eval.VAR_SPECIAL)] = function(t)
|
||||
return special_tab[t.vval.v_special]
|
||||
end,
|
||||
@ -63,7 +65,7 @@ local typvalt2lua_tab = {
|
||||
return tonumber(t.vval.v_float)
|
||||
end,
|
||||
[tonumber(eval.VAR_STRING)] = function(t)
|
||||
str = t.vval.v_string
|
||||
local str = t.vval.v_string
|
||||
if str == nil then
|
||||
return null_string
|
||||
else
|
||||
@ -82,8 +84,8 @@ local typvalt2lua_tab = {
|
||||
}
|
||||
|
||||
local typvalt2lua = function(t)
|
||||
return ((typvalt2lua_tab[tonumber(t.v_type)] or function(t)
|
||||
assert(false, 'Converting ' .. tonumber(t.v_type) .. ' was not implemented yet')
|
||||
return ((typvalt2lua_tab[tonumber(t.v_type)] or function(t_inner)
|
||||
assert(false, 'Converting ' .. tonumber(t_inner.v_type) .. ' was not implemented yet')
|
||||
end)(t))
|
||||
end
|
||||
|
||||
@ -105,8 +107,9 @@ lst2tbl = function(l)
|
||||
end
|
||||
|
||||
dct2tbl = function(d)
|
||||
local ret = {}
|
||||
local ret = {d=d}
|
||||
assert(false, 'Converting dictionaries is not implemented yet')
|
||||
return ret
|
||||
end
|
||||
|
||||
local lua2typvalt
|
||||
@ -119,7 +122,7 @@ local typvalt = function(typ, vval)
|
||||
end
|
||||
|
||||
local lua2typvalt_type_tab = {
|
||||
[int_type] = function(l, processed)
|
||||
[int_type] = function(l, _)
|
||||
return typvalt(eval.VAR_NUMBER, {v_number=l.value})
|
||||
end,
|
||||
[flt_type] = function(l, processed)
|
||||
|
Loading…
Reference in New Issue
Block a user