view src/testdir/test_fileformat.vim @ 10322:5adc318767be v8.0.0056

commit https://github.com/vim/vim/commit/d0b5138ba4bccff8a744c99836041ef6322ed39a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Nov 4 15:23:45 2016 +0100 patch 8.0.0056 Problem: When setting 'filetype' there is no check for a valid name. Solution: Only allow valid characters in 'filetype', 'syntax' and 'keymap'.
author Christian Brabandt <cb@256bit.org>
date Fri, 04 Nov 2016 15:30:07 +0100
parents c55a7232fb48
children 6a252c6afd5b
line wrap: on
line source

" 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