comparison src/testdir/test_vim9_disassemble.vim @ 19862:846fbbacce3a v8.2.0487

patch 8.2.0487: Vim9: compiling not sufficiently tested Commit: https://github.com/vim/vim/commit/bd5da371aafe5a2207065643502f4d1ff6b286c7 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 31 23:13:10 2020 +0200 patch 8.2.0487: Vim9: compiling not sufficiently tested Problem: Vim9: compiling not sufficiently tested. Solution: Add more tests. Fix bug with PCALL.
author Bram Moolenaar <Bram@vim.org>
date Tue, 31 Mar 2020 23:15:04 +0200
parents f03357f16ffc
children 50fa63ca3828
comparison
equal deleted inserted replaced
19861:e517915a786d 19862:846fbbacce3a
218 \ .. ' LOAD $\d.*' 218 \ .. ' LOAD $\d.*'
219 \ .. ' PCALL (argc 1).*' 219 \ .. ' PCALL (argc 1).*'
220 \ .. 'return "yes".*' 220 \ .. 'return "yes".*'
221 \ .. ' PUSHS "yes".*' 221 \ .. ' PUSHS "yes".*'
222 \ .. ' RETURN.*' 222 \ .. ' RETURN.*'
223 \, res)
224 enddef
225
226
227 def EchoArg(arg: string): string
228 return arg
229 enddef
230 def RefThis(): func
231 return function('EchoArg')
232 enddef
233 def s:ScriptPCall()
234 RefThis()("text")
235 enddef
236
237 def Test_disassemble_pcall()
238 let res = execute('disass s:ScriptPCall')
239 assert_match('<SNR>\d\+_ScriptPCall.*'
240 \ .. 'RefThis()("text").*'
241 \ .. '\d DCALL RefThis(argc 0).*'
242 \ .. '\d PUSHS "text".*'
243 \ .. '\d PCALL top (argc 1).*'
244 \ .. '\d PCALL end.*'
245 \ .. '\d DROP.*'
246 \ .. '\d PUSHNR 0.*'
247 \ .. '\d RETURN.*'
223 \, res) 248 \, res)
224 enddef 249 enddef
225 250
226 251
227 def FuncWithForwardCall(): string 252 def FuncWithForwardCall(): string