vim-patch:8.2.4991: no test for hwat patch 8.1.0535 fixes

Problem:    No test for hwat patch 8.1.0535 fixes.
Solution:   Add a test. (closes vim/vim#10462)
93c1573dd2
This commit is contained in:
zeertzjq 2022-05-22 05:43:38 +08:00
parent a1df7c5771
commit c3568b31f4

View File

@ -217,6 +217,26 @@ func Test_update_folds_expr_read()
set foldmethod& foldexpr& set foldmethod& foldexpr&
endfunc endfunc
" Test for what patch 8.1.0535 fixes.
func Test_foldexpr_no_interrupt_addsub()
new
func! FoldFunc()
call setpos('.', getcurpos())
return '='
endfunc
set foldmethod=expr
set foldexpr=FoldFunc()
call setline(1, '1.2')
exe "norm! $\<C-A>"
call assert_equal('1.3', getline(1))
bwipe!
delfunc FoldFunc
set foldmethod& foldexpr&
endfunc
func Check_foldlevels(expected) func Check_foldlevels(expected)
call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)')) call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)'))
endfunc endfunc