1
0
forked from aniani/vim

patch 8.2.0686: formatoptions not sufficiently tested

Problem:    Formatoptions not sufficiently tested.
Solution:   Add a few more tests. (Yegappan Lakshmanan, closes #6031)
This commit is contained in:
Bram Moolenaar
2020-05-03 16:04:43 +02:00
parent 3df02f507f
commit 2eaeaf3c31
3 changed files with 209 additions and 0 deletions

View File

@@ -204,6 +204,21 @@ func Test_normal05_formatexpr_setopt()
set formatexpr=
endfunc
" When 'formatexpr' returns non-zero, internal formatting is used.
func Test_normal_formatexpr_returns_nonzero()
new
call setline(1, ['one', 'two'])
func! Format()
return 1
endfunc
setlocal formatexpr=Format()
normal VGgq
call assert_equal(['one two'], getline(1, '$'))
setlocal formatexpr=
delfunc Format
close!
endfunc
" basic test for formatprg
func Test_normal06_formatprg()
" only test on non windows platform