diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-14 18:22:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-14 18:22:59 +0200 |
commit | b8be54dcc517c9d57b62409945b7d4b90b6c3071 (patch) | |
tree | f5eb85275a6b6f3a9eea3c819cb19e8c354f7991 /src/testdir/test_listdict.vim | |
parent | 37d9f175a4ab885052583746982d6bbfbe0095b9 (diff) | |
download | vim-git-b8be54dcc517c9d57b62409945b7d4b90b6c3071.tar.gz |
patch 8.1.1692: using *{} for literal dict is not backwards compatiblev8.1.1692
Problem: Using *{} for literal dict is not backwards compatible. (Yasuhiro
Matsumoto)
Solution: Use ~{} instead.
Diffstat (limited to 'src/testdir/test_listdict.vim')
-rw-r--r-- | src/testdir/test_listdict.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index 56c84a29d..20a31decf 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -281,8 +281,11 @@ func Test_dict_func_remove_in_use() endfunc func Test_dict_literal_keys() - call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, *{one: 1, two2: 2, 3three: 3, 44: 4},) - call assert_equal('2 3', trim(execute('echo 2 *{blue: 3}.blue'))) + call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, ~{one: 1, two2: 2, 3three: 3, 44: 4},) + + " why *{} cannot be used + let blue = 'blue' + call assert_equal('6', trim(execute('echo 2 *{blue: 3}.blue'))) endfunc " Nasty: deepcopy() dict that refers to itself (fails when noref used) |