fix(unittest): delete unused duplicated code

YAGNI. These were disabled 5 years ago in lint commit 29ed5b3a39
This commit is contained in:
bfredl
2023-01-18 12:12:13 +01:00
parent 9fdb586592
commit 847a1507aa

View File

@@ -7,9 +7,6 @@ local global_helpers = require('test.helpers')
local assert = require('luassert')
local say = require('say')
local posix = nil
local syscall = nil
local check_cores = global_helpers.check_cores
local dedent = global_helpers.dedent
local neq = global_helpers.neq
@@ -373,40 +370,8 @@ local function to_cstr(string)
return cstr(#string + 1, string)
end
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 = {
cimport_immediate('./test/unit/fixtures/posix.h')
local sc = {
fork = function()
return tonumber(ffi.C.fork())
end,
@@ -489,8 +454,7 @@ else
return stat_loc[0]
end,
exit = ffi.C._exit,
}
end
}
local function format_list(lst)
local ret = ''