changeset 24537:95bcea9faa52 v8.2.2808

patch 8.2.2808: Vim9: increment and decrement not sufficiently tested Commit: https://github.com/vim/vim/commit/730bf300202d82eff575581abc915b804275f18d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 24 20:43:56 2021 +0200 patch 8.2.2808: Vim9: increment and decrement not sufficiently tested Problem: Vim9: increment and decrement not sufficiently tested. Solution: Add assertions.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Apr 2021 20:45:04 +0200
parents 3f6c7cf8417c
children 93de24559a6f
files src/testdir/test_vim9_assign.vim src/version.c
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2808,
+/**/
     2807,
 /**/
     2806,