Mercurial > vim
diff src/testdir/test_listdict.vim @ 17368:6604ecb7a615 v8.1.1683
patch 8.1.1683: dictionary with string keys is longer than needed
commit https://github.com/vim/vim/commit/d5abb4c87727eecb71b0e8ffdda60fc9598272f3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 13 22:46:10 2019 +0200
patch 8.1.1683: dictionary with string keys is longer than needed
Problem: Dictionary with string keys is longer than needed.
Solution: Use *{key: val} for literaly keys.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Jul 2019 23:00:05 +0200 |
parents | d8ab4fa99341 |
children | 6f36caf4f702 |
line wrap: on
line diff
--- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -280,6 +280,10 @@ func Test_dict_func_remove_in_use() call assert_equal(expected, d.func(string(remove(d, 'func')))) 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},) +endfunc + " Nasty: deepcopy() dict that refers to itself (fails when noref used) func Test_dict_deepcopy() let d = {1:1, 2:2}