]> granicus.if.org Git - vim/commitdiff
patch 8.2.2808: Vim9: increment and decrement not sufficiently tested v8.2.2808
authorBram Moolenaar <Bram@vim.org>
Sat, 24 Apr 2021 18:43:56 +0000 (20:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 24 Apr 2021 18:43:56 +0000 (20:43 +0200)
Problem:    Vim9: increment and decrement not sufficiently tested.
Solution:   Add assertions.

src/testdir/test_vim9_assign.vim
src/version.c

index 246284c86f23dbcac2675492aabdf95476717d0e..fbc4d92af421b1edd38caed28859074adc380314 100644 (file)
@@ -1841,14 +1841,20 @@ def Test_inc_dec()
   var lines =<< trim END
       var nr = 7
       ++nr
-      echo nr
+      assert_equal(8, nr)
       --nr
-      echo nr
+      assert_equal(7, nr)
 
       var ll = [1, 2]
       --ll[0]
       ++ll[1]
-      echo ll
+      assert_equal([0, 3], ll)
+
+      g:count = 1
+      ++g:count
+      --g:count
+      assert_equal(1, g:count)
+      unlet g:count
   END
   CheckDefAndScriptSuccess(lines)
 enddef
index 842a7bcb8f1bc5018dae0c3c97a749072869658e..4b0b1cc3045fa7e6bd3754832a93bfdcae0a80e8 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2808,
 /**/
     2807,
 /**/