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(+) 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