api: nvim_buf_delete

This commit is contained in:
TJ DeVries
2020-10-09 15:39:59 -04:00
parent df726408d7
commit 78556aba7d
3 changed files with 86 additions and 0 deletions

View File

@@ -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'})