Patch 8.2.4835
Problem: Vim9: some lines not covered by tests.
Solution: Add a few more tests. Fix disassemble output.
Files: src/vim9execute.c, src/testdir/test_vim9_cmd.vim,
src/testdir/test_vim9_script.vim,
src/testdir/test_vim9_disassemble.vim
*** ../vim-8.2.4834/src/vim9execute.c 2022-04-27 17:54:20.147363240 +0100
--- src/vim9execute.c 2022-04-27 21:45:40.826898771 +0100
***************
*** 5571,5577 ****
break;
case ISN_LOADOUTER:
{
! if (iptr->isn_arg.number < 0)
smsg("%s%4d LOADOUTER level %d arg[%d]", pfx, current,
iptr->isn_arg.outer.outer_depth,
iptr->isn_arg.outer.outer_idx
--- 5571,5577 ----
break;
case ISN_LOADOUTER:
{
! if (iptr->isn_arg.outer.outer_idx < 0)
smsg("%s%4d LOADOUTER level %d arg[%d]", pfx, current,
iptr->isn_arg.outer.outer_depth,
iptr->isn_arg.outer.outer_idx
*** ../vim-8.2.4834/src/testdir/test_vim9_cmd.vim 2022-04-04
14:58:02.166539812 +0100
--- src/testdir/test_vim9_cmd.vim 2022-04-27 21:21:44.688768574 +0100
***************
*** 1691,1696 ****
--- 1691,1699 ----
endfor
assert_equal('yes no abc', getline(1))
+ setline(1, 'from')
+ v9.CheckDefExecFailure(['s/from/\=g:notexist/'], 'E121: Undefined variable:
g:notexist')
+
bwipe!
v9.CheckDefFailure(['s/from/\="x")/'], 'E488:')
*** ../vim-8.2.4834/src/testdir/test_vim9_script.vim 2022-04-23
10:50:18.971609285 +0100
--- src/testdir/test_vim9_script.vim 2022-04-27 21:13:28.153013112 +0100
***************
*** 2376,2381 ****
--- 2376,2389 ----
endfor
END
v9.CheckDefExecFailure(lines, 'E1017:', 1)
+
+ lines =<< trim END
+ for [a, b] in g:listlist
+ echo a
+ endfor
+ END
+ g:listlist = [1, 2, 3]
+ v9.CheckDefExecFailure(lines, 'E1140:', 1)
enddef
def Test_for_loop_with_try_continue()
*** ../vim-8.2.4834/src/testdir/test_vim9_disassemble.vim 2022-04-25
12:43:15.179819208 +0100
--- src/testdir/test_vim9_disassemble.vim 2022-04-27 22:12:19.217044503
+0100
***************
*** 899,904 ****
--- 899,923 ----
unlet g:Get
enddef
+ def s:ClosureArg(arg: string)
+ var Ref = () => arg .. "x"
+ enddef
+
+ def Test_disassemble_closure_arg()
+ var res = execute('disass s:ClosureArg')
+ assert_match('<SNR>\d\+_ClosureArg\_s*' ..
+ 'var Ref = () => arg .. "x"\_s*' ..
+ '\d FUNCREF <lambda>\d\+',
+ res)
+ var lres = execute('disass ' .. matchstr(res, '<lambda>\d\+'))
+ assert_match('<lambda>\d\+\_s*' ..
+ 'return arg .. "x"\_s*' ..
+ '\d LOADOUTER level 1 arg\[-1]\_s*' ..
+ '\d PUSHS "x"\_s*' ..
+ '\d CONCAT size 2\_s*' ..
+ '\d RETURN',
+ lres)
+ enddef
def EchoArg(arg: string): string
return arg
***************
*** 2664,2669 ****
--- 2683,2704 ----
res)
enddef
+ def s:RetLegacy(): string
+ legacy return "yes"
+ enddef
+
+ def Test_disassemble_return_legacy()
+ var res = execute('disass s:RetLegacy')
+ assert_match('<SNR>\d*_RetLegacy\_s*' ..
+ 'legacy return "yes"\_s*' ..
+ '\d CMDMOD legacy\_s*' ..
+ '\d EVAL legacy "yes"\_s*' ..
+ '\d CHECKTYPE string stack\[-1]\_s*' ..
+ '\d CMDMOD_REV\_s*' ..
+ '\d RETURN',
+ res)
+ enddef
+
def s:EchoMessages()
echohl ErrorMsg | echom v:exception | echohl NONE
enddef
*** ../vim-8.2.4834/src/version.c 2022-04-27 17:54:20.151363237 +0100
--- src/version.c 2022-04-27 21:14:06.160999164 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4835,
/**/
--
If bankers can count, how come they have eight windows and
only four tellers?
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220427211614.718371C0761%40moolenaar.net.