forked from aniani/vim
patch 8.2.0261: some code not covered by tests
Problem: Some code not covered by tests. Solution: Add test cases. (Yegappan Lakshmanan, closes #5645)
This commit is contained in:
@@ -276,3 +276,23 @@ func Test_fileformats()
|
||||
call delete('XXUxDsMc')
|
||||
call delete('Xtest')
|
||||
endfunc
|
||||
|
||||
" Test for changing the fileformat using ++read
|
||||
func Test_fileformat_plusplus_read()
|
||||
new
|
||||
call setline(1, ['one', 'two', 'three'])
|
||||
w ++ff=dos Xfile1
|
||||
enew!
|
||||
r ++fileformat=unix Xfile1
|
||||
call assert_equal('unix', &fileformat)
|
||||
3r ++edit Xfile1
|
||||
call assert_equal('dos', &fileformat)
|
||||
close!
|
||||
call delete('Xfile1')
|
||||
set fileformat&
|
||||
call assert_fails('e ++fileformat Xfile1', 'E474:')
|
||||
call assert_fails('e ++ff=abc Xfile1', 'E474:')
|
||||
call assert_fails('e ++abc1 Xfile1', 'E474:')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user