1
0
forked from aniani/vim

patch 8.2.2684: not enough folding code is tested

Problem:    Not enough folding code is tested.
Solution:   Add more test cases. (Yegappan Lakshmanan, closes #8046)
This commit is contained in:
Bram Moolenaar
2021-04-01 13:39:51 +02:00
parent b91d3f857f
commit 5c504f680e
4 changed files with 254 additions and 18 deletions

View File

@@ -1,5 +1,8 @@
" Tests for the :source command.
source check.vim
source view_util.vim
func Test_source_autocmd()
call writefile([
\ 'let did_source = 1',
@@ -93,4 +96,18 @@ func Test_source_error()
call assert_fails('scriptversion 2', 'E984:')
endfunc
" Test for sourcing a script recursively
func Test_nested_script()
CheckRunVimInTerminal
call writefile([':source! Xscript.vim', ''], 'Xscript.vim')
let buf = RunVimInTerminal('', {'rows': 6})
call term_wait(buf)
call term_sendkeys(buf, ":set noruler\n")
call term_sendkeys(buf, ":source! Xscript.vim\n")
call term_wait(buf)
call WaitForAssert({-> assert_match('E22: Scripts nested too deep\s*', term_getline(buf, 6))})
call delete('Xscript.vim')
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab