comparison src/testdir/test_fold.vim @ 20156:49694eceaa55 v8.2.0633

patch 8.2.0633: crash when using null partial in filter() Commit: https://github.com/vim/vim/commit/9d8d0b5c644ea53364d04403740b3f23e57c1497 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 24 22:47:31 2020 +0200 patch 8.2.0633: crash when using null partial in filter() Problem: Crash when using null partial in filter(). Solution: Fix crash. Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5976)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 Apr 2020 23:00:04 +0200
parents f9e41ffd3539
children 08940efa6b4e
comparison
equal deleted inserted replaced
20155:f413c0207fd1 20156:49694eceaa55
792 \ '" cc', 792 \ '" cc',
793 \ ], getline(1,'$')) 793 \ ], getline(1,'$'))
794 bwipe! 794 bwipe!
795 set foldmethod& 795 set foldmethod&
796 endfunc 796 endfunc
797
798 " Test for errors in 'foldexpr'
799 func Test_fold_expr_error()
800 new
801 call setline(1, ['one', 'two', 'three'])
802
803 " Return a list from the expression
804 set foldexpr=[]
805 set foldmethod=expr
806 for i in range(3)
807 call assert_equal(0, foldlevel(i))
808 endfor
809
810 " expression error
811 set foldexpr=[{]
812 set foldmethod=expr
813 for i in range(3)
814 call assert_equal(0, foldlevel(i))
815 endfor
816
817 set foldmethod& foldexpr&
818 close!
819 endfunc
820
821 " vim: shiftwidth=2 sts=2 expandtab