diff src/testdir/test_debugger.vim @ 24978:2818b8108d92 v8.2.3026

patch 8.2.3026: Vim9: cannot set breakpoint in compiled function Commit: https://github.com/vim/vim/commit/4f8f54280fa728b7d5a63b67d02b60a3b3dce543 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 20 19:28:14 2021 +0200 patch 8.2.3026: Vim9: cannot set breakpoint in compiled function Problem: Vim9: cannot set breakpoint in compiled function. Solution: Check for breakpoint when calling a function.
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Jun 2021 19:30:03 +0200
parents 64b70a958f19
children 2cb78583fada
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -932,6 +932,31 @@ func Test_Backtrace_DefFunction()
   call delete('Xtest2.vim')
 endfunc
 
+func Test_debug_DefFunction()
+  CheckCWD
+  let file =<< trim END
+    vim9script
+    def g:SomeFunc()
+      echo "here"
+      echo "and"
+      echo "there"
+    enddef
+    breakadd func 2 g:SomeFunc
+  END
+  call writefile(file, 'XtestDebug.vim')
+
+  let buf = RunVimInTerminal('-S XtestDebug.vim', {})
+
+  call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"'])
+  call RunDbgCmd(buf,'next', ['line 3: echo "there"'])
+
+  call RunDbgCmd(buf, 'cont')
+
+  call StopVimInTerminal(buf)
+  call delete('Xtest1.vim')
+  call delete('Xtest2.vim')
+endfunc
+
 func Test_debug_def_function()
   CheckCWD
   let file =<< trim END