Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 25660:7b80b25a5c2b v8.2.3366
patch 8.2.3366: Vim9: debugging elseif does not stop before condition
Commit: https://github.com/vim/vim/commit/093165c899f1620543844d1c1a7a05975697c286
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 22 13:35:31 2021 +0200
patch 8.2.3366: Vim9: debugging elseif does not stop before condition
Problem: Vim9: debugging elseif does not stop before condition.
Solution: Move debug statement to after the jump. (closes https://github.com/vim/vim/issues/8781)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 22 Aug 2021 13:45:04 +0200 |
parents | 27cb2e79ccde |
children | fe8d153cb268 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -2255,6 +2255,53 @@ def Test_debugged() res) enddef +def s:DebugElseif() + var b = false + if b + eval 1 + 0 + silent elseif !b + eval 2 + 0 + endif +enddef + +def Test_debug_elseif() + var res = execute('disass debug s:DebugElseif') + assert_match('<SNR>\d*_DebugElseif\_s*' .. + 'var b = false\_s*' .. + '0 DEBUG line 1-1 varcount 0\_s*' .. + '1 PUSH false\_s*' .. + '2 STORE $0\_s*' .. + + 'if b\_s*' .. + '3 DEBUG line 2-2 varcount 1\_s*' .. + '4 LOAD $0\_s*' .. + '5 JUMP_IF_FALSE -> 10\_s*' .. + + 'eval 1 + 0\_s*' .. + '6 DEBUG line 3-3 varcount 1\_s*' .. + '7 PUSHNR 1\_s*' .. + '8 DROP\_s*' .. + + 'silent elseif !b\_s*' .. + '9 JUMP -> 20\_s*' .. + '10 CMDMOD silent\_s*' .. + '11 DEBUG line 4-4 varcount 1\_s*' .. + '12 LOAD $0\_s*' .. + '13 INVERT -1 (!val)\_s*' .. + '14 CMDMOD_REV\_s*' .. + '15 JUMP_IF_FALSE -> 20\_s*' .. + + 'eval 2 + 0\_s*' .. + '16 DEBUG line 5-5 varcount 1\_s*' .. + '17 PUSHNR 2\_s*' .. + '18 DROP\_s*' .. + + 'endif\_s*' .. + '19 DEBUG line 6-6 varcount 1\_s*' .. + '20 RETURN void*', + res) +enddef + def s:EchoMessages() echohl ErrorMsg | echom v:exception | echohl NONE enddef