Mercurial > vim
comparison src/testdir/test_fileformat.vim @ 10672:0a6c66a06fdb v8.0.0226
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
commit https://github.com/vim/vim/commit/1695f99d08076d77ed3015f1edf09a668a4d449a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 13:18:43 2017 +0100
patch 8.0.0226: test for patch 8.0.0224 missing CR characters
Problem: The test for patch 8.0.0224 misses the CR characters and passes
even without the fix. (Christian Brabandt)
Solution: Use double quotes and \<CR>.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Jan 2017 13:30:04 +0100 |
parents | 6a252c6afd5b |
children | d6857a8dc07e |
comparison
equal
deleted
inserted
replaced
10671:e9f60fdded99 | 10672:0a6c66a06fdb |
---|---|
15 call assert_equal(test_fileformats, &fileformat) | 15 call assert_equal(test_fileformats, &fileformat) |
16 set fileformats& | 16 set fileformats& |
17 endfunc | 17 endfunc |
18 | 18 |
19 func Test_fileformat_autocommand() | 19 func Test_fileformat_autocommand() |
20 let filecnt=['', 'foobar', 'eins', '', 'zwei', 'drei', 'vier', 'fünf', ''] | 20 let filecnt = ["\<CR>", "foobar\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "drei", "vier", "fünf", ""] |
21 let ffs=&ffs | 21 let ffs = &ffs |
22 call writefile(filecnt, 'Xfile', 'b') | 22 call writefile(filecnt, 'Xfile', 'b') |
23 au BufReadPre Xfile set ffs=dos ff=dos | 23 au BufReadPre Xfile set ffs=dos ff=dos |
24 new Xfile | 24 new Xfile |
25 call assert_equal('dos', &l:ff) | 25 call assert_equal('dos', &l:ff) |
26 call assert_equal('dos', &ffs) | 26 call assert_equal('dos', &ffs) |
27 " cleanup | 27 |
28 let &ffs=ffs | 28 " cleanup |
29 au! BufReadPre Xfile | 29 call delete('Xfile') |
30 bw! | 30 let &ffs = ffs |
31 au! BufReadPre Xfile | |
32 bw! | |
31 endfunc | 33 endfunc |