Mercurial > vim
diff src/testdir/test_debugger.vim @ 25719:154663508d9b v8.2.3395
patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Commit: https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 2 18:49:06 2021 +0200
patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Problem: Vim9: expression breakpoint not checked in :def function.
Solution: Always compile a function for debugging if there is an expression
breakpoint. (closes #8803)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 02 Sep 2021 19:00:04 +0200 |
parents | bc1633df8a88 |
children | 5e7c96e9036d |
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim +++ b/src/testdir/test_debugger.vim @@ -932,6 +932,27 @@ func Test_Backtrace_DefFunction() call delete('Xtest2.vim') endfunc +func Test_DefFunction_expr() + CheckCWD + let file3 =<< trim END + vim9script + g:someVar = "foo" + def g:ChangeVar() + g:someVar = "bar" + echo "changed" + enddef + defcompile + END + call writefile(file3, 'Xtest3.vim') + let buf = RunVimInTerminal('-S Xtest3.vim', {}) + + call RunDbgCmd(buf, ':breakadd expr g:someVar') + call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"']) + + call StopVimInTerminal(buf) + call delete('Xtest3.vim') +endfunc + func Test_debug_def_and_legacy_function() CheckCWD let file =<< trim END