test: remove a few more redundant clear() calls (#35903)

This commit is contained in:
zeertzjq
2025-09-24 14:25:54 +08:00
committed by GitHub
parent b256e0476b
commit eb7c12d3e3
14 changed files with 13 additions and 40 deletions

View File

@@ -57,7 +57,6 @@ local function editoriginal(activate, lines)
lines = origlines
end
-- load up the file with the correct contents
clear()
return open(activate, lines)
end
@@ -507,8 +506,6 @@ describe('API: buffer events:', function()
end)
it('can notify several channels at once', function()
clear()
-- create several new sessions, in addition to our main API
local sessions = {}
local pipe = n.new_pipename()
@@ -781,8 +778,6 @@ describe('API: buffer events:', function()
end)
it('detaches if the buffer is unloaded/deleted/wiped', function()
-- start with a blank nvim
clear()
-- need to make a new window with a buffer because :bunload doesn't let you
-- unload the last buffer
for _, cmd in ipairs({ 'bunload', 'bdelete', 'bwipeout' }) do
@@ -798,20 +793,17 @@ describe('API: buffer events:', function()
end)
it('does not send the buffer content if not requested', function()
clear()
local b, tick = editoriginal(false)
ok(api.nvim_buf_attach(b, false, {}))
expectn('nvim_buf_changedtick_event', { b, tick })
end)
it('returns a proper error on nonempty options dict', function()
clear()
local b = editoriginal(false)
eq("Invalid key: 'builtin'", pcall_err(api.nvim_buf_attach, b, false, { builtin = 'asfd' }))
end)
it('nvim_buf_attach returns response after delay #8634', function()
clear()
sleep(250)
-- response
eq(true, n.request('nvim_buf_attach', 0, false, {}))