mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(unittest): delete unused duplicated code
YAGNI. These were disabled 5 years ago in lint commit 29ed5b3a39
This commit is contained in:
@@ -7,9 +7,6 @@ local global_helpers = require('test.helpers')
|
|||||||
local assert = require('luassert')
|
local assert = require('luassert')
|
||||||
local say = require('say')
|
local say = require('say')
|
||||||
|
|
||||||
local posix = nil
|
|
||||||
local syscall = nil
|
|
||||||
|
|
||||||
local check_cores = global_helpers.check_cores
|
local check_cores = global_helpers.check_cores
|
||||||
local dedent = global_helpers.dedent
|
local dedent = global_helpers.dedent
|
||||||
local neq = global_helpers.neq
|
local neq = global_helpers.neq
|
||||||
@@ -373,40 +370,8 @@ local function to_cstr(string)
|
|||||||
return cstr(#string + 1, string)
|
return cstr(#string + 1, string)
|
||||||
end
|
end
|
||||||
|
|
||||||
local sc
|
cimport_immediate('./test/unit/fixtures/posix.h')
|
||||||
|
local sc = {
|
||||||
if posix ~= nil then
|
|
||||||
sc = {
|
|
||||||
fork = posix.fork,
|
|
||||||
pipe = posix.pipe,
|
|
||||||
read = posix.read,
|
|
||||||
write = posix.write,
|
|
||||||
close = posix.close,
|
|
||||||
wait = posix.wait,
|
|
||||||
exit = posix._exit,
|
|
||||||
}
|
|
||||||
elseif syscall ~= nil then
|
|
||||||
sc = {
|
|
||||||
fork = syscall.fork,
|
|
||||||
pipe = function()
|
|
||||||
local ret = {syscall.pipe()}
|
|
||||||
return ret[3], ret[4]
|
|
||||||
end,
|
|
||||||
read = function(rd, len)
|
|
||||||
return rd:read(nil, len)
|
|
||||||
end,
|
|
||||||
write = function(wr, s)
|
|
||||||
return wr:write(s)
|
|
||||||
end,
|
|
||||||
close = function(p)
|
|
||||||
return p:close()
|
|
||||||
end,
|
|
||||||
wait = syscall.wait,
|
|
||||||
exit = syscall.exit,
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cimport_immediate('./test/unit/fixtures/posix.h')
|
|
||||||
sc = {
|
|
||||||
fork = function()
|
fork = function()
|
||||||
return tonumber(ffi.C.fork())
|
return tonumber(ffi.C.fork())
|
||||||
end,
|
end,
|
||||||
@@ -489,8 +454,7 @@ else
|
|||||||
return stat_loc[0]
|
return stat_loc[0]
|
||||||
end,
|
end,
|
||||||
exit = ffi.C._exit,
|
exit = ffi.C._exit,
|
||||||
}
|
}
|
||||||
end
|
|
||||||
|
|
||||||
local function format_list(lst)
|
local function format_list(lst)
|
||||||
local ret = ''
|
local ret = ''
|
||||||
|
Reference in New Issue
Block a user