comparison src/testdir/test_fileformat.vim @ 19407:2f4be7ca1b1b v8.2.0261

patch 8.2.0261: some code not covered by tests Commit: https://github.com/vim/vim/commit/f0cee1971f5258ce61f8a4e6a04d35c1e625bb01 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 16 13:33:56 2020 +0100 patch 8.2.0261: some code not covered by tests Problem: Some code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5645)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Feb 2020 13:45:04 +0100
parents 140bf183f946
children ba6afd154f91
comparison
equal deleted inserted replaced
19406:9f499efdf2aa 19407:2f4be7ca1b1b
274 call delete('XXDosMac') 274 call delete('XXDosMac')
275 call delete('XXMacEol') 275 call delete('XXMacEol')
276 call delete('XXUxDsMc') 276 call delete('XXUxDsMc')
277 call delete('Xtest') 277 call delete('Xtest')
278 endfunc 278 endfunc
279
280 " Test for changing the fileformat using ++read
281 func Test_fileformat_plusplus_read()
282 new
283 call setline(1, ['one', 'two', 'three'])
284 w ++ff=dos Xfile1
285 enew!
286 r ++fileformat=unix Xfile1
287 call assert_equal('unix', &fileformat)
288 3r ++edit Xfile1
289 call assert_equal('dos', &fileformat)
290 close!
291 call delete('Xfile1')
292 set fileformat&
293 call assert_fails('e ++fileformat Xfile1', 'E474:')
294 call assert_fails('e ++ff=abc Xfile1', 'E474:')
295 call assert_fails('e ++abc1 Xfile1', 'E474:')
296 endfunc
297
298 " vim: shiftwidth=2 sts=2 expandtab