Patch 8.2.4489 (after 8.2.4487)
Problem: Failing test for comparing v:null with number.
Solution: Allow comparing v:null with number in legacy script.
(Ken Takata, closes #9873) Also do this for float.
Files: src/typval.c, src/testdir/test_vimscript.vim
*** ../vim-8.2.4488/src/typval.c 2022-03-01 19:52:43.984788801 +0000
--- src/typval.c 2022-03-02 13:09:50.192137885 +0000
***************
*** 1405,1410 ****
--- 1405,1419 ----
case VAR_LIST: return tv->vval.v_list == NULL;
case VAR_PARTIAL: return tv->vval.v_partial == NULL;
case VAR_STRING: return tv->vval.v_string == NULL;
+
+ case VAR_NUMBER: if (!in_vim9script())
+ return tv->vval.v_number == 0;
+ break;
+ #ifdef FEAT_FLOAT
+ case VAR_FLOAT: if (!in_vim9script())
+ return tv->vval.v_float == 0.0;
+ break;
+ #endif
default: break;
}
}
*** ../vim-8.2.4488/src/testdir/test_vimscript.vim 2022-02-26 11:46:09.510212631 +0000
--- src/testdir/test_vimscript.vim 2022-03-02 13:11:59.751969415 +0000
***************
*** 6546,6554 ****
--- 6546,6561 ----
call assert_true(v:true != v:false)
call assert_true(v:null == 0)
+ call assert_false(v:null == 1)
call assert_false(v:null != 0)
call assert_true(v:none == 0)
+ call assert_false(v:none == 1)
call assert_false(v:none != 0)
+ if has('float')
+ call assert_true(v:null == 0.0)
+ call assert_false(v:null == 0.1)
+ call assert_false(v:null != 0.0)
+ endif
call assert_true(v:false is v:false)
call assert_true(v:true is v:true)
*** ../vim-8.2.4488/src/version.c 2022-03-01 19:52:43.984788801 +0000
--- src/version.c 2022-03-02 13:12:33.879925467 +0000
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 4489,
/**/
--
hundred-and-one symptoms of being an internet addict:
138. You develop a liking for cold coffee.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///