Mercurial > vim
comparison src/testdir/test_fileformat.vim @ 30051:13b02c1ea0f7 v9.0.0363
patch 9.0.0363: common names in test files causes tests to be flaky
Commit: https://github.com/vim/vim/commit/b18b49699776485150b71626069a40d12d2c5590
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 2 21:55:50 2022 +0100
patch 9.0.0363: common names in test files causes tests to be flaky
Problem: Common names in test files causes tests to be flaky.
Solution: Use more specific names.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 02 Sep 2022 23:00:04 +0200 |
parents | dc3d45d9a4a8 |
children | a7a9e8b9af89 |
comparison
equal
deleted
inserted
replaced
30050:4d0a9c80a90c | 30051:13b02c1ea0f7 |
---|---|
20 endfunc | 20 endfunc |
21 | 21 |
22 func Test_fileformat_autocommand() | 22 func Test_fileformat_autocommand() |
23 let filecnt = ["", "foobar\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "drei", "vier", "fünf", ""] | 23 let filecnt = ["", "foobar\<CR>", "eins\<CR>", "\<CR>", "zwei\<CR>", "drei", "vier", "fünf", ""] |
24 let ffs = &ffs | 24 let ffs = &ffs |
25 call writefile(filecnt, 'Xfile', 'b') | 25 call writefile(filecnt, 'Xffafile', 'b') |
26 au BufReadPre Xfile set ffs=dos ff=dos | 26 au BufReadPre Xffafile set ffs=dos ff=dos |
27 new Xfile | 27 new Xffafile |
28 call assert_equal('dos', &l:ff) | 28 call assert_equal('dos', &l:ff) |
29 call assert_equal('dos', &ffs) | 29 call assert_equal('dos', &ffs) |
30 | 30 |
31 " cleanup | 31 " cleanup |
32 call delete('Xfile') | 32 call delete('Xffafile') |
33 let &ffs = ffs | 33 let &ffs = ffs |
34 au! BufReadPre Xfile | 34 au! BufReadPre Xffafile |
35 bw! | 35 bw! |
36 endfunc | 36 endfunc |
37 | 37 |
38 func Test_fileformat_nomodifiable() | 38 func Test_fileformat_nomodifiable() |
39 new | 39 new |
312 | 312 |
313 " When Vim starts up with an empty buffer the first item in 'fileformats' is | 313 " When Vim starts up with an empty buffer the first item in 'fileformats' is |
314 " used as the 'fileformat'. | 314 " used as the 'fileformat'. |
315 func Test_fileformat_on_startup() | 315 func Test_fileformat_on_startup() |
316 let after =<< trim END | 316 let after =<< trim END |
317 call writefile([&fileformat], 'Xfile', 'a') | 317 call writefile([&fileformat], 'Xonsfile', 'a') |
318 quit | 318 quit |
319 END | 319 END |
320 call RunVim(["set ffs=dos,unix,mac"], after, '') | 320 call RunVim(["set ffs=dos,unix,mac"], after, '') |
321 call RunVim(["set ffs=mac,dos,unix"], after, '') | 321 call RunVim(["set ffs=mac,dos,unix"], after, '') |
322 call RunVim(["set ffs=unix,mac,dos"], after, '') | 322 call RunVim(["set ffs=unix,mac,dos"], after, '') |
323 call assert_equal(['dos', 'mac', 'unix'], readfile('Xfile')) | 323 call assert_equal(['dos', 'mac', 'unix'], readfile('Xonsfile')) |
324 call delete('Xfile') | 324 call delete('Xonsfile') |
325 endfunc | 325 endfunc |
326 | 326 |
327 " vim: shiftwidth=2 sts=2 expandtab | 327 " vim: shiftwidth=2 sts=2 expandtab |