Mercurial > vim
annotate src/testdir/test_fileformat.vim @ 15178:5c3ca8f7adea v8.1.0599
patch 8.1.0599: without the +eval feature the indent tests don't work
commit https://github.com/vim/vim/commit/eeed665b0ecd917e88e3475c9615d52546aa124d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 15 17:43:42 2018 +0100
patch 8.1.0599: without the +eval feature the indent tests don't work
Problem: Without the +eval feature the indent tests don't work.
Solution: Skip the body of the tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 15 Dec 2018 17:45:04 +0100 |
parents | d6857a8dc07e |
children | 140bf183f946 |
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 |
10668
6a252c6afd5b
patch 8.0.0224: change to 'fileformats' from autocmd does not take effect
Christian Brabandt <cb@256bit.org>
parents:
10268
diff
changeset
|
18 |
6a252c6afd5b
patch 8.0.0224: change to 'fileformats' from autocmd does not take effect
Christian Brabandt <cb@256bit.org>
parents:
10268
diff
changeset
|
19 func Test_fileformat_autocommand() |
10674
d6857a8dc07e
patch 8.0.0227: crash with ff=dos when first line in file has no CR
Christian Brabandt <cb@256bit.org>
parents:
10672
diff
changeset
|
20 let filecnt = ["", "foobar\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "drei", "vier", "fünf", ""] |
10672
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
21 let ffs = &ffs |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
22 call writefile(filecnt, 'Xfile', 'b') |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
23 au BufReadPre Xfile set ffs=dos ff=dos |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
24 new Xfile |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
25 call assert_equal('dos', &l:ff) |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
26 call assert_equal('dos', &ffs) |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
27 |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
28 " cleanup |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
29 call delete('Xfile') |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
30 let &ffs = ffs |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
31 au! BufReadPre Xfile |
0a6c66a06fdb
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Christian Brabandt <cb@256bit.org>
parents:
10668
diff
changeset
|
32 bw! |
10668
6a252c6afd5b
patch 8.0.0224: change to 'fileformats' from autocmd does not take effect
Christian Brabandt <cb@256bit.org>
parents:
10268
diff
changeset
|
33 endfunc |