aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_fold.vim
diff options
context:
space:
mode:
Diffstat (limited to 'test/old/testdir/test_fold.vim')
-rw-r--r--test/old/testdir/test_fold.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/old/testdir/test_fold.vim b/test/old/testdir/test_fold.vim
index e529a94174..eae6952e72 100644
--- a/test/old/testdir/test_fold.vim
+++ b/test/old/testdir/test_fold.vim
@@ -1578,4 +1578,17 @@ func Test_foldexpr_return_empty_string()
bwipe!
endfunc
+" Make sure that when ending a fold that hasn't been started, it does not
+" start a new fold.
+func Test_foldexpr_end_fold()
+ new
+ setlocal foldmethod=expr
+ let &l:foldexpr = 'v:lnum == 2 ? "<2" : "="'
+ call setline(1, range(1, 3))
+ redraw
+ call assert_equal([0, 0, 0], range(1, 3)->map('foldlevel(v:val)'))
+
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab