diff src/testdir/test_fileformat.vim @ 10268:c55a7232fb48 v8.0.0031

commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 12 17:45:29 2016 +0200 patch 8.0.0031 Problem: After ":bwipeout" 'fileformat' is not set to the right default. Solution: Get the default from 'fileformats'. (Mike Williams)
author Christian Brabandt <cb@256bit.org>
date Wed, 12 Oct 2016 18:00:04 +0200
parents
children 6a252c6afd5b
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_fileformat.vim
@@ -0,0 +1,17 @@
+" Test behavior of fileformat after bwipeout of last buffer
+
+func Test_fileformat_after_bw()
+  bwipeout
+  set fileformat&
+  if &fileformat == 'dos'
+    let test_fileformats = 'unix'
+  elseif &fileformat == 'unix'
+    let test_fileformats = 'mac'
+  else  " must be mac
+    let test_fileformats = 'dos'
+  endif
+  exec 'set fileformats='.test_fileformats
+  bwipeout!
+  call assert_equal(test_fileformats, &fileformat)
+  set fileformats&
+endfunc