patch 8.2.2849: bufwrite not sufficiently tested
Problem: Bufwrite not sufficiently tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes #8192)
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index 6e81470..1f14e86 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -1270,4 +1270,19 @@
call delete('Xprogname', 'd')
endfunc
+" Test for doing a write from .vimrc
+func Test_write_in_vimrc()
+ call writefile(['silent! write'], 'Xvimrc')
+ let after =<< trim [CODE]
+ call assert_match('E32: ', v:errmsg)
+ call writefile(v:errors, 'Xtestout')
+ qall
+ [CODE]
+ if RunVim([], after, '-u Xvimrc')
+ call assert_equal([], readfile('Xtestout'))
+ call delete('Xtestout')
+ endif
+ call delete('Xvimrc')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab