0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00
Files
vim/src/testdir/test_exists_autocmd.vim
Bram Moolenaar 6d91bcb4d2 patch 8.2.1432: various inconsistencies in test files
Problem:    Various inconsistencies in test files.
Solution:   Add modelines where they were missing.  Use Check commands instead
            of silently skipping over tests.  Adjust indents and comments.
            (Ken Takata, closes #6695)
2020-08-12 18:50:36 +02:00

29 lines
905 B
VimL

" Test that groups and patterns are tested correctly when calling exists() for
" autocommands.
function Test_AutoCommands()
let results=[]
augroup auexists
augroup END
call assert_true(exists("##BufEnter"))
call assert_false(exists("#BufEnter"))
au BufEnter * let g:entered=1
call assert_true(exists("#BufEnter"))
call assert_false(exists("#auexists#BufEnter"))
augroup auexists
au BufEnter * let g:entered=1
augroup END
call assert_true(exists("#auexists#BufEnter"))
call assert_false(exists("#BufEnter#*.test"))
au BufEnter *.test let g:entered=1
call assert_true(exists("#BufEnter#*.test"))
edit testfile.test
call assert_false(exists("#BufEnter#<buffer>"))
au BufEnter <buffer> let g:entered=1
call assert_true(exists("#BufEnter#<buffer>"))
edit testfile2.test
call assert_false(exists("#BufEnter#<buffer>"))
endfunction
" vim: shiftwidth=2 sts=2 expandtab