diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-03 16:49:30 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-03 16:49:30 +0300 |
commit | c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57 (patch) | |
tree | b7e59c416d1435725c65f8952b6e55c70544d97e /test/functional/autocmd/autocmd_spec.lua | |
parent | 62108c3b0be46936c83f6d4c98b44ceb5e6f77fd (diff) | |
parent | 27a577586eace687c47e7398845178208cae524a (diff) | |
download | rneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.tar.gz rneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.tar.bz2 rneovim-c49e22d3964d6c7ae1c24e8ad01b5fec4ca40b57.zip |
Merge branch 'master' into s-dash-stdin
Diffstat (limited to 'test/functional/autocmd/autocmd_spec.lua')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index c38bd75c69..8ee9462a8d 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -1,9 +1,13 @@ local helpers = require('test.functional.helpers')(after_each) -local clear = helpers.clear -local command = helpers.command local eq = helpers.eq local eval = helpers.eval +local clear = helpers.clear +local meths = helpers.meths +local expect = helpers.expect +local command = helpers.command +local exc_exec = helpers.exc_exec +local curbufmeths = helpers.curbufmeths describe('autocmds:', function() before_each(clear) @@ -33,4 +37,22 @@ describe('autocmds:', function() it('v:vim_did_enter is 1 after VimEnter', function() eq(1, eval('v:vim_did_enter')) end) + + describe('BufLeave autocommand', function() + it('can wipe out the buffer created by :edit which triggered autocmd', + function() + meths.set_option('hidden', true) + curbufmeths.set_lines(0, 1, false, { + 'start of test file xx', + 'end of test file xx'}) + + command('autocmd BufLeave * bwipeout yy') + eq('Vim(edit):E143: Autocommands unexpectedly deleted new buffer yy', + exc_exec('edit yy')) + + expect([[ + start of test file xx + end of test file xx]]) + end) + end) end) |