Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 19912:d4fa9db88d16 v8.2.0512
patch 8.2.0512: Vim9: no optional arguments in func type
Commit: https://github.com/vim/vim/commit/5deeb3f1f9db4eabd36e99cbf857fe376eb37e10
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 5 17:08:17 2020 +0200
patch 8.2.0512: Vim9: no optional arguments in func type
Problem: Vim9: no optional arguments in func type.
Solution: Check for question mark after type. Find function reference
without function().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 Apr 2020 17:15:25 +0200 |
parents | bd4f91762d0f |
children | e9af5a09a55b |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -87,8 +87,10 @@ enddef def Test_disassemble_store() let res = execute('disass s:ScriptFuncStore') assert_match('<SNR>\d*_ScriptFuncStore.*' + \ .. 'let localnr = 1.*' \ .. 'localnr = 2.*' \ .. ' STORE 2 in $0.*' + \ .. 'let localstr = ''abc''.*' \ .. 'localstr = ''xyz''.*' \ .. ' STORE $1.*' \ .. 'v:char = ''abc''.*' @@ -360,22 +362,22 @@ def Test_disassemble_const_expr() enddef def WithFunc() - let funky1: func - let funky2: func = function("len") - let party2: func = funcref("UserFunc") + let Funky1: func + let Funky2: func = function("len") + let Party2: func = funcref("UserFunc") enddef def Test_disassemble_function() let instr = execute('disassemble WithFunc') assert_match('WithFunc.*' - \ .. 'let funky1: func.*' + \ .. 'let Funky1: func.*' \ .. '0 PUSHFUNC "\[none]".*' \ .. '1 STORE $0.*' - \ .. 'let funky2: func = function("len").*' + \ .. 'let Funky2: func = function("len").*' \ .. '2 PUSHS "len".*' \ .. '3 BCALL function(argc 1).*' \ .. '4 STORE $1.*' - \ .. 'let party2: func = funcref("UserFunc").*' + \ .. 'let Party2: func = funcref("UserFunc").*' \ .. '\d PUSHS "UserFunc".*' \ .. '\d BCALL funcref(argc 1).*' \ .. '\d STORE $2.*'