Mercurial > vim
comparison src/testdir/test_vim9_disassemble.vim @ 20079:336483164ca6 v8.2.0595
patch 8.2.0595: Vim9: not all commands using ends_excmd() tested
Commit: https://github.com/vim/vim/commit/a26b9700d73ebccd6c5459d0d66032a4249f6b72
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 18 19:53:28 2020 +0200
patch 8.2.0595: Vim9: not all commands using ends_excmd() tested
Problem: Vim9: not all commands using ends_excmd() tested.
Solution: Find # comment after regular commands. Add more tests. Report
error for where it was caused.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 18 Apr 2020 20:00:04 +0200 |
parents | 8fb1cf4c44d5 |
children | 7fc5d62fe2a5 |
comparison
equal
deleted
inserted
replaced
20078:61222b5d173d | 20079:336483164ca6 |
---|---|
249 '\d RETURN.*', | 249 '\d RETURN.*', |
250 res) | 250 res) |
251 enddef | 251 enddef |
252 | 252 |
253 | 253 |
254 def FuncWithForwardCall(): string | 254 def s:FuncWithForwardCall(): string |
255 return DefinedLater("yes") | 255 return g:DefinedLater("yes") |
256 enddef | 256 enddef |
257 | 257 |
258 def DefinedLater(arg: string): string | 258 def DefinedLater(arg: string): string |
259 return arg | 259 return arg |
260 enddef | 260 enddef |
261 | 261 |
262 def Test_disassemble_update_instr() | 262 def Test_disassemble_update_instr() |
263 let res = execute('disass FuncWithForwardCall') | 263 let res = execute('disass s:FuncWithForwardCall') |
264 assert_match('FuncWithForwardCall.*' .. | 264 assert_match('FuncWithForwardCall.*' .. |
265 'return DefinedLater("yes").*' .. | 265 'return g:DefinedLater("yes").*' .. |
266 '\d PUSHS "yes".*' .. | 266 '\d PUSHS "yes".*' .. |
267 '\d UCALL DefinedLater(argc 1).*' .. | 267 '\d UCALL g:DefinedLater(argc 1).*' .. |
268 '\d CHECKTYPE string stack\[-1].*' .. | 268 '\d CHECKTYPE string stack\[-1].*' .. |
269 '\d RETURN.*', | 269 '\d RETURN.*', |
270 res) | 270 res) |
271 | 271 |
272 " Calling the function will change UCALL into the faster DCALL | 272 " Calling the function will change UCALL into the faster DCALL |
273 assert_equal('yes', FuncWithForwardCall()) | 273 assert_equal('yes', FuncWithForwardCall()) |
274 | 274 |
275 res = execute('disass FuncWithForwardCall') | 275 res = execute('disass s:FuncWithForwardCall') |
276 assert_match('FuncWithForwardCall.*' .. | 276 assert_match('FuncWithForwardCall.*' .. |
277 'return DefinedLater("yes").*' .. | 277 'return g:DefinedLater("yes").*' .. |
278 '\d PUSHS "yes".*' .. | 278 '\d PUSHS "yes".*' .. |
279 '\d DCALL DefinedLater(argc 1).*' .. | 279 '\d DCALL DefinedLater(argc 1).*' .. |
280 '\d CHECKTYPE string stack\[-1].*' .. | 280 '\d CHECKTYPE string stack\[-1].*' .. |
281 '\d RETURN.*', | 281 '\d RETURN.*', |
282 res) | 282 res) |