From 5559cabf4d851edb94cc2f09d50bcf0a04bd0819 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 26 Oct 2022 22:38:47 +0800 Subject: vim-patch:8.2.0531: various errors not tested Problem: Various errors not tested. Solution: Add tests. (Yegappan Lakshmanan, closes vim/vim#5895) https://github.com/vim/vim/commit/476a613135bdc94e61c1dce8a9cbb4ab0b6dc2d1 Need to remove "F" flag from 'shortmess' as early as possible. --- src/nvim/testdir/test_source.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir/test_source.vim') diff --git a/src/nvim/testdir/test_source.vim b/src/nvim/testdir/test_source.vim index ba6fd5ad95..0fd923abf2 100644 --- a/src/nvim/testdir/test_source.vim +++ b/src/nvim/testdir/test_source.vim @@ -87,4 +87,10 @@ func Test_source_autocmd_sfile() call delete('Xscript.vim') endfunc +func Test_source_error() + call assert_fails('scriptencoding utf-8', 'E167:') + call assert_fails('finish', 'E168:') + " call assert_fails('scriptversion 2', 'E984:') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From ba360a26a294e0ed83ff8e401caabaf4a17c7c30 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 25 Nov 2022 15:07:25 +0800 Subject: 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. --- src/nvim/testdir/test_source.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/nvim/testdir/test_source.vim') 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 -- cgit