diff src/testdir/test_options.vim @ 19693:9fbeb3bdf49e v8.2.0403

patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check Commit: https://github.com/vim/vim/commit/a3a9c8ef697bbf6f640cde99710b6f534f29f77d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 19 12:38:34 2020 +0100 patch 8.2.0403: when 'buftype' is "nofile" there is no overwrite check Problem: When 'buftype' is "nofile" there is no overwrite check. Solution: Also check for existing file when 'buftype' is set. (closes #5807)
author Bram Moolenaar <Bram@vim.org>
date Thu, 19 Mar 2020 12:45:04 +0100
parents bab20768e1fd
children a653d1a165ef
line wrap: on
line diff
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -656,7 +656,15 @@ func Test_buftype()
   call setline(1, ['L1'])
   set buftype=nowrite
   call assert_fails('write', 'E382:')
-  close!
+
+  for val in ['', 'nofile', 'nowrite', 'acwrite', 'quickfix', 'help', 'terminal', 'prompt', 'popup']
+    exe 'set buftype=' .. val
+    call writefile(['something'], 'XBuftype')
+    call assert_fails('write XBuftype', 'E13:', 'with buftype=' .. val)
+  endfor
+
+  call delete('XBuftype')
+  bwipe!
 endfunc
 
 " Test for the 'shellquote' option