aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-08-02 13:15:16 +0800
committerGitHub <noreply@github.com>2024-08-02 13:15:16 +0800
commit76dea5feaa1ab3f2e987ac3ff35238f8e29f2242 (patch)
tree075b4793350d5bef55da000f89d75d90ecfc7c7e /test
parent48e4589eaded3213956aa9ddbcc0aa6971a974e5 (diff)
parent99bb0a10d3400ee8b9b2773d51a957dacbf52b33 (diff)
downloadrneovim-76dea5feaa1ab3f2e987ac3ff35238f8e29f2242.tar.gz
rneovim-76dea5feaa1ab3f2e987ac3ff35238f8e29f2242.tar.bz2
rneovim-76dea5feaa1ab3f2e987ac3ff35238f8e29f2242.zip
Merge pull request #29951 from zeertzjq/vim-9.0.0632
vim-patch:9.0.{0632,0634,0635},9.1.0649
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_fold.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/old/testdir/test_fold.vim b/test/old/testdir/test_fold.vim
index 36f72f5e01..a0eb3afdbb 100644
--- a/test/old/testdir/test_fold.vim
+++ b/test/old/testdir/test_fold.vim
@@ -386,6 +386,32 @@ func Test_foldexpr_no_interrupt_addsub()
set foldmethod& foldexpr&
endfunc
+" Fold function defined in another script
+func Test_foldexpr_compiled()
+ throw 'Skipped: Vim9 script is N/A'
+ new
+ let lines =<< trim END
+ vim9script
+ def FoldFunc(): number
+ return v:lnum
+ enddef
+
+ set foldmethod=expr
+ set foldexpr=s:FoldFunc()
+ END
+ call writefile(lines, 'XfoldExpr', 'D')
+ source XfoldExpr
+
+ call setline(1, ['one', 'two', 'three'])
+ redraw
+ call assert_equal(1, foldlevel(1))
+ call assert_equal(2, foldlevel(2))
+ call assert_equal(3, foldlevel(3))
+
+ bwipe!
+ set foldmethod& foldexpr&
+endfunc
+
func Check_foldlevels(expected)
call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)'))
endfunc