annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10268
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test behavior of fileformat after bwipeout of last buffer
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_fileformat_after_bw()
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 bwipeout
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 set fileformat&
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 if &fileformat == 'dos'
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 let test_fileformats = 'unix'
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 elseif &fileformat == 'unix'
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 let test_fileformats = 'mac'
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 else " must be mac
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 let test_fileformats = 'dos'
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 endif
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 exec 'set fileformats='.test_fileformats
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 bwipeout!
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 call assert_equal(test_fileformats, &fileformat)
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 set fileformats&
c55a7232fb48 commit https://github.com/vim/vim/commit/e8ef3a093453b73594e15462d4de50b011c8ba66
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 endfunc