mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
api: nvim_buf_delete
This commit is contained in:
@@ -534,6 +534,26 @@ describe('api/buf', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_buf_delete', function()
|
||||
it('allows for just deleting', function()
|
||||
nvim('command', 'new')
|
||||
local b = nvim('get_current_buf')
|
||||
ok(buffer('is_valid', b))
|
||||
nvim('buf_delete', b, {})
|
||||
ok(not buffer('is_loaded', b))
|
||||
ok(not buffer('is_valid', b))
|
||||
end)
|
||||
|
||||
it('allows for just unloading', function()
|
||||
nvim('command', 'new')
|
||||
local b = nvim('get_current_buf')
|
||||
ok(buffer('is_valid', b))
|
||||
nvim('buf_delete', b, { unload = true })
|
||||
ok(not buffer('is_loaded', b))
|
||||
ok(buffer('is_valid', b))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_buf_get_mark', function()
|
||||
it('works', function()
|
||||
curbuf('set_lines', -1, -1, true, {'a', 'bit of', 'text'})
|
||||
|
||||
Reference in New Issue
Block a user