aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-13 06:50:20 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-11-13 06:55:58 +0800
commit331d213c0b35066fb53830f9d71ebf6b9dfdce2a (patch)
tree73cee90e204b33cc60a93b67daede7e502e4d0d0 /test
parent49d126e005211d6fbe54bccff9aa0f0e1eeefcef (diff)
downloadrneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.tar.gz
rneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.tar.bz2
rneovim-331d213c0b35066fb53830f9d71ebf6b9dfdce2a.zip
vim-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 vim/vim#8803) https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_debugger.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/old/testdir/test_debugger.vim b/test/old/testdir/test_debugger.vim
index fce80a948a..5836523898 100644
--- a/test/old/testdir/test_debugger.vim
+++ b/test/old/testdir/test_debugger.vim
@@ -971,6 +971,28 @@ func Test_Backtrace_DefFunction()
call delete('Xtest2.vim')
endfunc
+func Test_DefFunction_expr()
+ CheckRunVimInTerminal
+ 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()
CheckRunVimInTerminal
CheckCWD