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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user