mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-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.
3e9c0b9608
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -480,6 +480,19 @@ func Test_dict_func_remove_in_use()
|
|||||||
endfunc
|
endfunc
|
||||||
let expected = 'a:' . string(get(d, 'func'))
|
let expected = 'a:' . string(get(d, 'func'))
|
||||||
call assert_equal(expected, d.func(string(remove(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
|
endfunc
|
||||||
|
|
||||||
func Test_dict_literal_keys()
|
func Test_dict_literal_keys()
|
||||||
|
Reference in New Issue
Block a user