aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/legacy/009_bufleave_autocommand_spec.lua22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/functional/legacy/009_bufleave_autocommand_spec.lua b/test/functional/legacy/009_bufleave_autocommand_spec.lua
index 7481c639cf..e2b3dca685 100644
--- a/test/functional/legacy/009_bufleave_autocommand_spec.lua
+++ b/test/functional/legacy/009_bufleave_autocommand_spec.lua
@@ -1,19 +1,27 @@
-- Test for Bufleave autocommand that deletes the buffer we are about to edit.
local helpers = require('test.functional.helpers')(after_each)
-local clear, insert = helpers.clear, helpers.insert
-local execute, expect = helpers.execute, helpers.expect
+
+local eq = helpers.eq
+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('BufLeave autocommand', function()
setup(clear)
it('is working', function()
- insert([[
- start of test file xx
- end of test file xx]])
+ meths.set_option('hidden', true)
+ curbufmeths.set_lines(0, 1, false, {
+ 'start of test file xx',
+ 'end of test file xx'})
- execute('au BufLeave * bwipe yy')
- execute('e yy')
+ 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