summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-10 21:47:43 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-10 21:47:43 +0200
commitf163bd5e41e8ea1d32e7977e671598a9d6f7b23c (patch)
tree89429218a74bdf64027a9c204e6911d1f967d297 /src/testdir/test_vim9_cmd.vim
parent7e5bd91dc99e1ecb38c4220eaab1a906a69815c2 (diff)
patch 8.2.0732: Vim9: storing value in dict messes up stackv8.2.0732
Problem: Vim9: storing value in dict messes up stack. Solution: Correct item count of stack.
Diffstat (limited to 'src/testdir/test_vim9_cmd.vim')
-rw-r--r--src/testdir/test_vim9_cmd.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim
index 12260c3558..55d756a676 100644
--- 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