aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-07 05:34:20 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-07 05:34:20 +0800
commitb3a14a71b095f9ad2abffbc9b61ae574907f2c21 (patch)
tree1b0fd46de5e1695fb10f740ee8baa6edc1a9992a /src
parent6a00b1689653546f0469d7f449b3709430f5883b (diff)
downloadrneovim-b3a14a71b095f9ad2abffbc9b61ae574907f2c21.tar.gz
rneovim-b3a14a71b095f9ad2abffbc9b61ae574907f2c21.tar.bz2
rneovim-b3a14a71b095f9ad2abffbc9b61ae574907f2c21.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_vimscript.vim24
1 files changed, 24 insertions, 0 deletions
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
"-------------------------------------------------------------------------------