Mercurial > vim
diff src/testdir/test_listdict.vim @ 25593:c6277019b8c1 v8.2.3333
patch 8.2.3333: Vim9: not enough tests run with Vim9
Commit: https://github.com/vim/vim/commit/3e9c0b9608736e7d888f3141443f8754143364d7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 12 10:39:10 2021 +0200
patch 8.2.3333: Vim9: not enough tests run with Vim9
Problem: Vim9: not enough tests run with Vim9.
Solution: Run a few more tests in Vim9 script and :def function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 12 Aug 2021 10:45:02 +0200 |
parents | ea69398b40d1 |
children | c4e29355cd8b |
line wrap: on
line diff
--- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -457,6 +457,19 @@ func Test_dict_func_remove_in_use() endfunc let expected = 'a:' . string(get(d, 'func')) call assert_equal(expected, d.func(string(remove(d, 'func')))) + + " similar, in a way it also works in Vim9 + let lines =<< trim END + VAR d = {1: 1, 2: 'x'} + func GetArg(a) + return "a:" .. a:a + endfunc + LET d.func = function('GetArg') + VAR expected = 'a:' .. string(get(d, 'func')) + call assert_equal(expected, d.func(string(remove(d, 'func')))) + END + call CheckTransLegacySuccess(lines) + call CheckTransVim9Success(lines) endfunc func Test_dict_literal_keys()