aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_source.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-25 15:07:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-25 15:50:34 +0800
commitba360a26a294e0ed83ff8e401caabaf4a17c7c30 (patch)
treeed9b268528cbf11ca4445a4e659e94f639f4c9a6 /src/nvim/testdir/test_source.vim
parent2738f842f6da712ec0648620d846bfacb14bdcef (diff)
downloadrneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.tar.gz
rneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.tar.bz2
rneovim-ba360a26a294e0ed83ff8e401caabaf4a17c7c30.zip
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 vim/vim#8046) https://github.com/vim/vim/commit/5c504f680e63120fea36becfabb8d939d4449e34 Reorder test_fold.vim to match upstream. Cherry-pick Test_fold_expr_error() from patch 8.2.0633. Cherry-pick syntax feature check from patch 8.2.1432. Cherry-pick a delete() call from patch 8.2.2112.
Diffstat (limited to 'src/nvim/testdir/test_source.vim')
-rw-r--r--src/nvim/testdir/test_source.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_source.vim b/src/nvim/testdir/test_source.vim
index 0fd923abf2..d4d96e36bf 100644
--- a/src/nvim/testdir/test_source.vim
+++ b/src/nvim/testdir/test_source.vim
@@ -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