mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 08:02:38 +00:00
refactor(tests): lift retry() into assert_log()
This commit is contained in:
@@ -295,9 +295,7 @@ describe('tmpdir', function()
|
||||
clear({ env={ NVIM_LOG_FILE=testlog, TMPDIR=faketmp, } })
|
||||
matches(tmproot_pat, funcs.stdpath('run')) -- Tickle vim_mktempdir().
|
||||
-- Assert that broken tmpdir root was handled.
|
||||
retry(nil, 1000, function()
|
||||
assert_log('tempdir root not a directory', testlog, 100)
|
||||
end)
|
||||
assert_log('tempdir root not a directory', testlog, 100)
|
||||
|
||||
-- "…/nvim.<user>/" has wrong permissions:
|
||||
skip(is_os('win'), 'TODO(justinmk): need setfperm/getfperm on Windows. #8244')
|
||||
@@ -308,9 +306,7 @@ describe('tmpdir', function()
|
||||
clear({ env={ NVIM_LOG_FILE=testlog, TMPDIR=faketmp, } })
|
||||
matches(tmproot_pat, funcs.stdpath('run')) -- Tickle vim_mktempdir().
|
||||
-- Assert that broken tmpdir root was handled.
|
||||
retry(nil, 1000, function()
|
||||
assert_log('tempdir root has invalid permissions', testlog, 100)
|
||||
end)
|
||||
assert_log('tempdir root has invalid permissions', testlog, 100)
|
||||
end)
|
||||
|
||||
it('too long', function()
|
||||
|
||||
@@ -6,7 +6,6 @@ local eq = helpers.eq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local expect_exit = helpers.expect_exit
|
||||
local request = helpers.request
|
||||
local retry = helpers.retry
|
||||
|
||||
describe('log', function()
|
||||
local testlog = 'Xtest_logging'
|
||||
@@ -40,9 +39,7 @@ describe('log', function()
|
||||
}})
|
||||
|
||||
local tid = _G._nvim_test_id
|
||||
retry(nil, 1000, function()
|
||||
assert_log(tid..'%.%d+%.%d +server_init:%d+: test log message', testlog, 100)
|
||||
end)
|
||||
assert_log(tid..'%.%d+%.%d +server_init:%d+: test log message', testlog, 100)
|
||||
|
||||
exec_lua([[
|
||||
local j1 = vim.fn.jobstart({ vim.v.progpath, '-es', '-V1', '+foochild', '+qa!' }, vim.empty_dict())
|
||||
@@ -50,8 +47,6 @@ describe('log', function()
|
||||
]])
|
||||
|
||||
-- Child Nvim spawned by jobstart() appends "/c" to parent name.
|
||||
retry(nil, 1000, function()
|
||||
assert_log('%.%d+%.%d/c +server_init:%d+: test log message', testlog, 100)
|
||||
end)
|
||||
assert_log('%.%d+%.%d/c +server_init:%d+: test log message', testlog, 100)
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -43,10 +43,8 @@ describe('startup', function()
|
||||
|
||||
it('--startuptime', function()
|
||||
clear({ args = {'--startuptime', testfile}})
|
||||
retry(nil, 1000, function()
|
||||
assert_log('sourcing', testfile, 100)
|
||||
assert_log("require%('vim%._editor'%)", testfile, 100)
|
||||
end)
|
||||
assert_log('sourcing', testfile, 100)
|
||||
assert_log("require%('vim%._editor'%)", testfile, 100)
|
||||
end)
|
||||
|
||||
it('-D does not hang #12647', function()
|
||||
|
||||
Reference in New Issue
Block a user