From 406cd90f1963ca60813db91c413eef4b1b78ee44 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 18 Feb 2020 21:54:41 +0100 Subject: patch 8.2.0275: some Ex code not covered by tests Problem: Some Ex code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes #5659) --- src/testdir/test_autocmd.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/testdir/test_autocmd.vim') diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 3b071049c2..a16329b8cd 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2358,4 +2358,28 @@ func Test_FileType_spell() setglobal spellfile= endfunc +" Test closing a window or editing another buffer from a FileChangedRO handler +" in a readonly buffer +func Test_FileChangedRO_winclose() + augroup FileChangedROTest + au! + autocmd FileChangedRO * quit + augroup END + new + set readonly + call assert_fails('normal i', 'E788:') + close + augroup! FileChangedROTest + + augroup FileChangedROTest + au! + autocmd FileChangedRO * edit Xfile + augroup END + new + set readonly + call assert_fails('normal i', 'E788:') + close + augroup! FileChangedROTest +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3