diff src/testdir/test_vim9_assign.vim @ 24533:9c404d78d767 v8.2.2806

patch 8.2.2806: Vim9: using "++nr" as a command might not work Commit: https://github.com/vim/vim/commit/bdc0f1c6986e5d64f647e0924a4de795b47c549a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 24 19:08:24 2021 +0200 patch 8.2.2806: Vim9: using "++nr" as a command might not work Problem: Vim9: using "++nr" as a command might not work. Solution: Do not recognize "++" and "--" in a following line as addition or subtraction.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Apr 2021 19:15:04 +0200
parents 3bfec39ce31c
children 95bcea9faa52
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -1837,5 +1837,21 @@ def Test_script_funcref_case()
   CheckScriptFailure(lines, 'E704:')
 enddef
 
+def Test_inc_dec()
+  var lines =<< trim END
+      var nr = 7
+      ++nr
+      echo nr
+      --nr
+      echo nr
+
+      var ll = [1, 2]
+      --ll[0]
+      ++ll[1]
+      echo ll
+  END
+  CheckDefAndScriptSuccess(lines)
+enddef
+
 
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker