Mercurial > vim
view src/testdir/test_exists_autocmd.vim @ 19279:25cb7ab433c6 v8.2.0198
patch 8.2.0198: no tests for y/n prompt
Commit: https://github.com/vim/vim/commit/43c60eda2aa22ba3d7aaf418cfbdb75f1a008e67
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 2 15:55:19 2020 +0100
patch 8.2.0198: no tests for y/n prompt
Problem: No tests for y/n prompt.
Solution: Add tests. (Dominique Pelle, closes https://github.com/vim/vim/issues/5564)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 02 Feb 2020 16:00:09 +0100 |
parents | 140d51d5b5c3 |
children | 08940efa6b4e |
line wrap: on
line source
" 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