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)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 3b07104..a16329b 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -2358,4 +2358,28 @@
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