]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1500: The falsy operator is not tested properly v9.0.1500
authorzeertzjq <zeertzjq@outlook.com>
Sun, 30 Apr 2023 14:29:56 +0000 (15:29 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 30 Apr 2023 14:29:56 +0000 (15:29 +0100)
Problem:    The falsy operator is not tested properly.
Solution:   Add a few more test cases. (closes #12319)

src/testdir/test_expr.vim
src/version.c

index c3543676b0594e79b10a22e6870737bc77ea064a..4e02de010a20504dc5b0b6bc43a9250ec29a872c 100644 (file)
@@ -86,6 +86,21 @@ func Test_op_falsy()
       call assert_equal(456, [] ?? 456)
       call assert_equal(456, {} ?? 456)
       call assert_equal(456, 0.0 ?? 456)
+
+      call assert_equal(456, v:null ?? 456)
+      call assert_equal(456, v:none ?? 456)
+      call assert_equal(456, test_null_string() ?? 456)
+      call assert_equal(456, test_null_blob() ?? 456)
+      call assert_equal(456, test_null_list() ?? 456)
+      call assert_equal(456, test_null_dict() ?? 456)
+      call assert_equal(456, test_null_function() ?? 456)
+      call assert_equal(456, test_null_partial() ?? 456)
+      if has('job')
+        call assert_equal(456, test_null_job() ?? 456)
+      endif
+      if has('channel')
+        call assert_equal(456, test_null_channel() ?? 456)
+      endif
   END
   call v9.CheckLegacyAndVim9Success(lines)
 endfunc
index 460b49b9e67b903ef1b3e9187e33edc3439b3e57..b81b734975edf2af3708e6fbf809e523d15f047b 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1500,
 /**/
     1499,
 /**/