summaryrefslogtreecommitdiff
path: root/src/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-29 20:54:59 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-29 20:54:59 +0200
commitb3435b0a3a0967115658d0a8c0224a28969cfa02 (patch)
treeba3e92bbd27469c2517d930906088d6d40f8549d /src/testdir/test_autocmd.vim
parentb9c31e71f5a4653a27e81c21226039bfa35b9131 (diff)
downloadvim-b3435b0a3a0967115658d0a8c0224a28969cfa02.zip
patch 8.0.0019
Problem: Test_command_count is old style. Solution: Turn it into a new style test. (Naruhiko Nishino) Use more assert functions.
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r--src/testdir/test_autocmd.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 5402fc665..6ebfee45e 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -1,5 +1,13 @@
" Tests for autocommands
+function! s:cleanup_buffers() abort
+ for bnr in range(1, bufnr('$'))
+ if bufloaded(bnr) && bufnr('%') != bnr
+ execute 'bd! ' . bnr
+ endif
+ endfor
+endfunction
+
func Test_vim_did_enter()
call assert_false(v:vim_did_enter)
@@ -254,6 +262,9 @@ endfunc
" Tests for autocommands on :close command.
" This used to be in test13.
func Test_three_windows()
+ " Clean up buffers, because in some cases this function fails.
+ call s:cleanup_buffers()
+
" Write three files and open them, each in a window.
" Then go to next window, with autocommand that deletes the previous one.
" Do this twice, writing the file.