aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-01-06 09:47:30 -0500
committerGitHub <noreply@github.com>2017-01-06 09:47:30 -0500
commitf82f27ccec4e42ba28a9924738e3611d8ca6c626 (patch)
tree845b0fb0d0e2934dd845d6f62a551c005405068f /src/nvim/testdir
parent23b39ebb24d6468d6dda76ffbb88f1fd3b99501c (diff)
parent6c69bc978848df8bb268b74b0e5a01eeb87a32dd (diff)
downloadrneovim-f82f27ccec4e42ba28a9924738e3611d8ca6c626.tar.gz
rneovim-f82f27ccec4e42ba28a9924738e3611d8ca6c626.tar.bz2
rneovim-f82f27ccec4e42ba28a9924738e3611d8ca6c626.zip
Merge pull request #5892 from lonerover/vim-7.4.2103
vim-patch: 7.4.2103
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 1dceb70cd4..5675697dc4 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -19,6 +19,7 @@ if has('timers')
call timer_start(100, 'ExitInsertMode')
call feedkeys('a', 'x!')
call assert_equal(1, g:triggered)
+ au! CursorHoldI
endfunc
func Test_cursorhold_insert_ctrl_x()
@@ -29,6 +30,7 @@ if has('timers')
" CursorHoldI does not trigger after CTRL-X
call feedkeys("a\<C-X>", 'x!')
call assert_equal(0, g:triggered)
+ au! CursorHoldI
endfunc
endif
@@ -58,5 +60,34 @@ function Test_bufunload()
bwipeout
call assert_equal(["bufunload", "bufdelete", "bufwipeout"], s:li)
+ au! test_bufunload_group
augroup! test_bufunload_group
endfunc
+
+func s:AddAnAutocmd()
+ augroup vimBarTest
+ au BufReadCmd * echo 'hello'
+ augroup END
+ call assert_equal(3, len(split(execute('au vimBarTest'), "\n")))
+endfunc
+
+func Test_early_bar()
+ " test that a bar is recognized before the {event}
+ call s:AddAnAutocmd()
+ augroup vimBarTest | au! | augroup END
+ call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
+
+ call s:AddAnAutocmd()
+ augroup vimBarTest| au!| augroup END
+ call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
+
+ " test that a bar is recognized after the {event}
+ call s:AddAnAutocmd()
+ augroup vimBarTest| au!BufReadCmd| augroup END
+ call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
+
+ " test that a bar is recognized after the {group}
+ call s:AddAnAutocmd()
+ au! vimBarTest|echo 'hello'
+ call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
+endfunc