Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 19483:0d3dcb4476ba v8.2.0299
patch 8.2.0299: Vim9: ISN_STORE with argument not tested
Commit: https://github.com/vim/vim/commit/8ed04587d3cd53e29be20fde9c36e619ea7da4dc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 22 19:07:28 2020 +0100
patch 8.2.0299: Vim9: ISN_STORE with argument not tested
Problem: Vim9: ISN_STORE with argument not tested. Some cases in tv2bool()
not tested.
Solution: Add tests. Add test_unknown() and test_void().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 22 Feb 2020 19:15:04 +0100 |
parents | b347a6c61090 |
children | 3b026343f398 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -221,6 +221,23 @@ def Test_disassemble_call() \, res) enddef + +def FuncWithDefault(arg: string = 'default'): string + return arg +enddef + +def Test_disassemble_call_default() + let res = execute('disass FuncWithDefault') + assert_match('FuncWithDefault.*' + \ .. '\d PUSHS "default".*' + \ .. '\d STORE arg\[-1].*' + \ .. 'return arg.*' + \ .. '\d LOAD arg\[-1].*' + \ .. '\d RETURN.*' + \, res) +enddef + + def HasEval() if has("eval") echo "yes"