diff src/testdir/test_vim9_cmd.vim @ 20353:a8a76fd967ab v8.2.0732

patch 8.2.0732: Vim9: storing value in dict messes up stack Commit: https://github.com/vim/vim/commit/f163bd5e41e8ea1d32e7977e671598a9d6f7b23c Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 10 21:47:43 2020 +0200 patch 8.2.0732: Vim9: storing value in dict messes up stack Problem: Vim9: storing value in dict messes up stack. Solution: Correct item count of stack.
author Bram Moolenaar <Bram@vim.org>
date Sun, 10 May 2020 22:00:04 +0200
parents e29b2ec8d4d2
children 524fa1d42e1e
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -54,6 +54,12 @@ def Test_assign_list()
   assert_equal('asdf', l[1])
   assert_equal('asdf', l[-1])
   assert_equal('value', l[-2])
+
+  let nrl: list<number> = []
+  for i in range(5)
+    nrl[i] = i
+  endfor
+  assert_equal([0, 1, 2, 3, 4], nrl)
 enddef
 
 def Test_assign_dict()
@@ -64,6 +70,12 @@ def Test_assign_dict()
   d[123] = 'qwerty'
   assert_equal('qwerty', d[123])
   assert_equal('qwerty', d['123'])
+
+  let nrd: dict<number> = {}
+  for i in range(3)
+    nrd[i] = i
+  endfor
+  assert_equal({'0': 0, '1': 1, '2': 2}, nrd)
 enddef