diff src/testdir/test_debugger.vim @ 26252:3d92646fe6c8 v8.2.3657

patch 8.2.3657: Vim9: debug text misses one line of return statement Commit: https://github.com/vim/vim/commit/112bed0cbeac84f73dca2682c5c2d74fabe1114d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 23 22:16:34 2021 +0000 patch 8.2.3657: Vim9: debug text misses one line of return statement Problem: Vim9: debug text misses one line of return statement. Solution: Add a line when not at a debug instruction. (closes https://github.com/vim/vim/issues/9137)
author Bram Moolenaar <Bram@vim.org>
date Tue, 23 Nov 2021 23:30:03 +0100
parents 485c7c4afeb7
children fc859aea8cec
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -373,6 +373,29 @@ def Test_Debugger_breakadd_expr()
   call delete('Xtest.vim')
 enddef
 
+def Test_Debugger_break_at_return()
+  var lines =<< trim END
+      vim9script
+      def g:GetNum(): number
+        return 1
+          + 2
+          + 3
+      enddef
+      breakadd func GetNum
+  END
+  writefile(lines, 'Xtest.vim')
+
+  # Start Vim in a terminal
+  var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
+  call TermWait(buf)
+
+  RunDbgCmd(buf, ':call GetNum()',
+     ['line 1: return 1  + 2  + 3'], {match: 'pattern'})
+
+  call StopVimInTerminal(buf)
+  call delete('Xtest.vim')
+enddef
+
 func Test_Backtrace_Through_Source()
   CheckCWD
   let file1 =<< trim END