diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-08-23 12:11:05 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-23 17:48:12 +0800 |
| commit | a9e6cf0e64ede3fc26226fed3a5f94a7f5020918 (patch) | |
| tree | 0abdc8c22d68f6439a56d11cbc65e22000fb1790 /src/nvim/testdir | |
| parent | ffa1335047047ac00280ac742bcc6dfcc7fa3589 (diff) | |
| download | rneovim-a9e6cf0e64ede3fc26226fed3a5f94a7f5020918.tar.gz rneovim-a9e6cf0e64ede3fc26226fed3a5f94a7f5020918.tar.bz2 rneovim-a9e6cf0e64ede3fc26226fed3a5f94a7f5020918.zip | |
vim-patch:8.2.4740: when expand() fails there is no error message
Problem: When expand() fails there is no error message.
Solution: When 'verbose' is set give an error message.
https://github.com/vim/vim/commit/575445200bd35283191ecd7a0d596b37c5b477a4
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_expand.vim | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_expand.vim b/src/nvim/testdir/test_expand.vim index 4b9140ef50..6579e09d5e 100644 --- a/src/nvim/testdir/test_expand.vim +++ b/src/nvim/testdir/test_expand.vim @@ -116,13 +116,21 @@ func Test_source_sfile() :call assert_equal('edit <cword>', expandcmd("edit <cword>")) :call assert_equal('edit <cexpr>', expandcmd("edit <cexpr>")) :call assert_fails('autocmd User MyCmd echo "<sfile>"', 'E498:') + : + :call assert_equal('', expand('<script>')) + :verbose echo expand('<script>') + :call add(v:errors, v:errmsg) + :verbose echo expand('<sfile>') + :call add(v:errors, v:errmsg) :call writefile(v:errors, 'Xresult') :qall! - [SCRIPT] call writefile(lines, 'Xscript') if RunVim([], [], '--clean -s Xscript') - call assert_equal([], readfile('Xresult')) + call assert_equal([ + \ 'E1274: No script file name to substitute for "<script>"', + \ 'E498: no :source file name to substitute for "<sfile>"'], + \ readfile('Xresult')) endif call delete('Xscript') call delete('Xresult') |