From 7b8fcf0234441a7db29897d60c728ad2adb83464 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1163 Problem: Expressions "0 + v:true" and "'' . v:true" cause an error. Solution: Return something sensible when using a special variable as a number or as a string. (suggested by Damien) https://github.com/vim/vim/commit/17a13437c9414a8693369a97f3be2fc8ad48c12e Code is N/A. This only ports the tests. Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index c59cab5f36..c3e882ad05 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1156,6 +1156,16 @@ func Test_type() call assert_equal(v:t_list, type(v:_null_list)) call assert_equal(v:t_dict, type(v:_null_dict)) call assert_equal(v:t_blob, type(v:_null_blob)) + + call assert_equal(0, 0 + v:false) + call assert_equal(1, 0 + v:true) + " call assert_equal(0, 0 + v:none) + call assert_equal(0, 0 + v:null) + + call assert_equal('false', '' . v:false) + call assert_equal('true', '' . v:true) + " call assert_equal('none', '' . v:none) + call assert_equal('null', '' . v:null) endfunc "------------------------------------------------------------------------------- -- cgit From 6a00b1689653546f0469d7f449b3709430f5883b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1164 Problem: No tests for comparing special variables. Error in jsondecode() not reported. test_json does not work Japanse system. Solution: Set scriptencoding. (Ken Takata) Add a few more tests. Add error. https://github.com/vim/vim/commit/6039c7f05376f0e470cf62bf2757e653aea357f3 Code is N/A. This only ports the tests. Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index c3e882ad05..fc95d70a88 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1166,6 +1166,18 @@ func Test_type() call assert_equal('true', '' . v:true) " call assert_equal('none', '' . v:none) call assert_equal('null', '' . v:null) + + call assert_true(v:false == 0) + call assert_false(v:false != 0) + call assert_true(v:true == 1) + call assert_false(v:true != 1) + call assert_false(v:true == v:false) + call assert_true(v:true != v:false) + + call assert_true(v:null == 0) + call assert_false(v:null != 0) + " call assert_true(v:none == 0) + " call assert_false(v:none != 0) endfunc "------------------------------------------------------------------------------- -- cgit From b3a14a71b095f9ad2abffbc9b61ae574907f2c21 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1167 Problem: No tests for "is" and "isnot" with the new variables. Solution: Add tests. https://github.com/vim/vim/commit/04369229657f182d35b471eb8b38f273a4d9ef65 Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index fc95d70a88..674a28f154 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1178,6 +1178,30 @@ func Test_type() call assert_false(v:null != 0) " call assert_true(v:none == 0) " call assert_false(v:none != 0) + + call assert_true(v:false is v:false) + call assert_true(v:true is v:true) + " call assert_true(v:none is v:none) + call assert_true(v:null is v:null) + + call assert_false(v:false isnot v:false) + call assert_false(v:true isnot v:true) + " call assert_false(v:none isnot v:none) + call assert_false(v:null isnot v:null) + + call assert_false(v:false is 0) + call assert_false(v:true is 1) + call assert_false(v:true is v:false) + " call assert_false(v:none is 0) + call assert_false(v:null is 0) + " call assert_false(v:null is v:none) + + call assert_true(v:false isnot 0) + call assert_true(v:true isnot 1) + call assert_true(v:true isnot v:false) + " call assert_true(v:none isnot 0) + call assert_true(v:null isnot 0) + " call assert_true(v:null isnot v:none) endfunc "------------------------------------------------------------------------------- -- cgit From bf8f2ebb79d4c16dae0268ef26bdbc032069000d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1173 Problem: No test for new behavior of v:true et al. Solution: Add a test. https://github.com/vim/vim/commit/65591001e405cbaaf9772c9375d0bb6049cf9a3a Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 674a28f154..4088aa33dc 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1202,6 +1202,11 @@ func Test_type() " call assert_true(v:none isnot 0) call assert_true(v:null isnot 0) " call assert_true(v:null isnot v:none) + + call assert_equal(v:false, eval(string(v:false))) + call assert_equal(v:true, eval(string(v:true))) + " call assert_equal(v:none, eval(string(v:none))) + call assert_equal(v:null, eval(string(v:null))) endfunc "------------------------------------------------------------------------------- -- cgit From 3fa5d501835becf68bd50498fe74c786c792d6d6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1178 Problem: empty() doesn't work for the new special variables. Solution: Make empty() work. (Damien) https://github.com/vim/vim/commit/767d8c1a1ae762ecf47297c168b8c23caf05d30a Code is N/A. This only ports the tests. Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 4088aa33dc..75a1b1a881 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1207,6 +1207,11 @@ func Test_type() call assert_equal(v:true, eval(string(v:true))) " call assert_equal(v:none, eval(string(v:none))) call assert_equal(v:null, eval(string(v:null))) + + call assert_true(empty(v:false)) + call assert_false(empty(v:true)) + call assert_true(empty(v:null)) + " call assert_true(empty(v:none)) endfunc "------------------------------------------------------------------------------- -- cgit From a937fc53ef3652b81be247d8ddad091652327a71 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1181 Problem: free_tv() can't handle special variables. (Damien) Solution: Add the variable type. https://github.com/vim/vim/commit/6650a694547eb744afa060ec62dd8270e99db9f2 Code is N/A. This only ports the tests. --- src/nvim/testdir/test_vimscript.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 75a1b1a881..0d9aa647fd 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1212,6 +1212,16 @@ func Test_type() call assert_false(empty(v:true)) call assert_true(empty(v:null)) " call assert_true(empty(v:none)) + + func ChangeYourMind() + try + return v:true + finally + return 'something else' + endtry + endfunc + + call ChangeYourMind() endfunc "------------------------------------------------------------------------------- -- cgit From e6e9ffb3456607747132e398039ea8de16553a52 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:7.4.1228 Problem: copy() and deepcopy() fail with special variables. (Nikolai Pavlov) Solution: Make it work. Add a test. Closes vim/vim#614. https://github.com/vim/vim/commit/155500077c80cdb5d9c63996000c011b66a676bf Code is N/A. This only ports the tests. Comment out tests involving v:none as Nvim has removed it. --- src/nvim/testdir/test_vimscript.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index 0d9aa647fd..a8c0c941c3 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -1208,6 +1208,16 @@ func Test_type() " call assert_equal(v:none, eval(string(v:none))) call assert_equal(v:null, eval(string(v:null))) + call assert_equal(v:false, copy(v:false)) + call assert_equal(v:true, copy(v:true)) + " call assert_equal(v:none, copy(v:none)) + call assert_equal(v:null, copy(v:null)) + + call assert_equal([v:false], deepcopy([v:false])) + call assert_equal([v:true], deepcopy([v:true])) + " call assert_equal([v:none], deepcopy([v:none])) + call assert_equal([v:null], deepcopy([v:null])) + call assert_true(empty(v:false)) call assert_false(empty(v:true)) call assert_true(empty(v:null)) -- cgit From fe621b4ac01c6865650794b8e986665be4fe0ae7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 7 Feb 2022 05:34:20 +0800 Subject: vim-patch:8.1.0711: test files still use function! Problem: Test files still use function!. Solution: Remove the exclamation mark. Fix overwriting a function. https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7 Some of the changes were already applied previously. --- src/nvim/testdir/test_vimscript.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/testdir/test_vimscript.vim') diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim index a8c0c941c3..75a965f16d 100644 --- a/src/nvim/testdir/test_vimscript.vim +++ b/src/nvim/testdir/test_vimscript.vim @@ -25,7 +25,7 @@ com! -nargs=1 Xout call Xout() " in the variable argument list. This function is useful if similar tests are " to be made for a ":return" from a function call or a ":finish" in a script " file. -function! MakeScript(funcname, ...) +func MakeScript(funcname, ...) let script = tempname() execute "redir! >" . script execute "function" a:funcname @@ -1224,11 +1224,11 @@ func Test_type() " call assert_true(empty(v:none)) func ChangeYourMind() - try - return v:true - finally - return 'something else' - endtry + try + return v:true + finally + return 'something else' + endtry endfunc call ChangeYourMind() -- cgit