diff src/testdir/test_startup.vim @ 24620:9f48b262539b v8.2.2849

patch 8.2.2849: bufwrite not sufficiently tested Commit: https://github.com/vim/vim/commit/36f96a515109dc1fad279571a645c0f0d65f2de4 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu May 13 18:33:16 2021 +0200 patch 8.2.2849: bufwrite not sufficiently tested Problem: Bufwrite not sufficiently tested. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8192)
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 May 2021 18:45:02 +0200
parents acd9220bdd0b
children 08eced3add83
line wrap: on
line diff
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -1270,4 +1270,19 @@ func Test_progname()
   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