From f1b8683b8c2f4a48d501c9dedef664f17761b8ac Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 23 Aug 2022 13:24:40 +0800 Subject: vim-patch:8.2.4841: empty string considered an error for expand() Problem: Empty string considered an error for expand() when 'verbose' is set. (Christian Brabandt) Solution: Do not give an error for an empty result. (closes vim/vim#10307) https://github.com/vim/vim/commit/a96edb736d4274fc4aea460800780e06e1510812 --- src/nvim/testdir/test_expand_func.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_expand_func.vim') diff --git a/src/nvim/testdir/test_expand_func.vim b/src/nvim/testdir/test_expand_func.vim index df01d84f19..dfe4ce105c 100644 --- a/src/nvim/testdir/test_expand_func.vim +++ b/src/nvim/testdir/test_expand_func.vim @@ -107,10 +107,14 @@ endfunc func Test_expand() new - call assert_equal("", expand('%:S')) + call assert_equal("''", expand('%:S')) call assert_equal('3', ''->expand()) call assert_equal(['4'], expand('', v:false, v:true)) " Don't add any line above this, otherwise will change. + call assert_equal("", expand('%')) + set verbose=1 + call assert_equal("", expand('%')) + set verbose=0 quit endfunc -- cgit From d459b6687704b7d1f230d0b14c0d59f87cf5f67d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 23 Aug 2022 13:31:07 +0800 Subject: vim-patch:8.2.4842: expand("%:p") is not empty when there is no buffer name Problem: expand("%:p") is not empty when there is no buffer name. Solution: When ignoring errors still return NULL. (closes vim/vim#10311) https://github.com/vim/vim/commit/211a5bb2353c66684f38527184a258921f95c9d9 --- src/nvim/testdir/test_expand_func.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_expand_func.vim') diff --git a/src/nvim/testdir/test_expand_func.vim b/src/nvim/testdir/test_expand_func.vim index dfe4ce105c..80bfdb8553 100644 --- a/src/nvim/testdir/test_expand_func.vim +++ b/src/nvim/testdir/test_expand_func.vim @@ -107,7 +107,7 @@ endfunc func Test_expand() new - call assert_equal("''", expand('%:S')) + call assert_equal("", expand('%:S')) call assert_equal('3', ''->expand()) call assert_equal(['4'], expand('', v:false, v:true)) " Don't add any line above this, otherwise will change. @@ -115,6 +115,7 @@ func Test_expand() set verbose=1 call assert_equal("", expand('%')) set verbose=0 + call assert_equal("", expand('%:p')) quit endfunc -- cgit