Mercurial > vim
comparison src/testdir/test_fileformat.vim @ 24946:dc3d45d9a4a8 v8.2.3010
patch 8.2.3010: not enough testing for viminfo code
Commit: https://github.com/vim/vim/commit/41a7f82dea525b3398bf372cbb9c268455845800
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Wed Jun 16 15:53:17 2021 +0200
patch 8.2.3010: not enough testing for viminfo code
Problem: Not enough testing for viminfo code.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8390)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Jun 2021 16:00:04 +0200 |
parents | 6d3dee0d7de5 |
children | 13b02c1ea0f7 |
comparison
equal
deleted
inserted
replaced
24945:a98c7315519b | 24946:dc3d45d9a4a8 |
---|---|
1 " Test for 'fileformat' | 1 " Test for 'fileformat' |
2 | |
3 source shared.vim | |
2 | 4 |
3 " Test behavior of fileformat after bwipeout of last buffer | 5 " Test behavior of fileformat after bwipeout of last buffer |
4 func Test_fileformat_after_bw() | 6 func Test_fileformat_after_bw() |
5 bwipeout | 7 bwipeout |
6 set fileformat& | 8 set fileformat& |
306 call assert_fails('e ++fileformat Xfile1', 'E474:') | 308 call assert_fails('e ++fileformat Xfile1', 'E474:') |
307 call assert_fails('e ++ff=abc Xfile1', 'E474:') | 309 call assert_fails('e ++ff=abc Xfile1', 'E474:') |
308 call assert_fails('e ++abc1 Xfile1', 'E474:') | 310 call assert_fails('e ++abc1 Xfile1', 'E474:') |
309 endfunc | 311 endfunc |
310 | 312 |
313 " When Vim starts up with an empty buffer the first item in 'fileformats' is | |
314 " used as the 'fileformat'. | |
315 func Test_fileformat_on_startup() | |
316 let after =<< trim END | |
317 call writefile([&fileformat], 'Xfile', 'a') | |
318 quit | |
319 END | |
320 call RunVim(["set ffs=dos,unix,mac"], after, '') | |
321 call RunVim(["set ffs=mac,dos,unix"], after, '') | |
322 call RunVim(["set ffs=unix,mac,dos"], after, '') | |
323 call assert_equal(['dos', 'mac', 'unix'], readfile('Xfile')) | |
324 call delete('Xfile') | |
325 endfunc | |
326 | |
311 " vim: shiftwidth=2 sts=2 expandtab | 327 " vim: shiftwidth=2 sts=2 expandtab |