diff src/testdir/test_debugger.vim @ 25763:5e7c96e9036d v8.2.3417

patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing Commit: https://github.com/vim/vim/commit/072f1c68884a1e2d468a0f39e27fc28168fb4b03 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 8 20:40:34 2021 +0200 patch 8.2.3417: Vim9: a failing debug expression aborts script sourcing Problem: Vim9: a failing debug expression aborts script sourcing. Solution: Do not let expression failure abort script sourcing. (closes https://github.com/vim/vim/issues/8848)
author Bram Moolenaar <Bram@vim.org>
date Wed, 08 Sep 2021 20:45:03 +0200
parents 154663508d9b
children dfa045d2cc89
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -318,7 +318,9 @@ func Test_Debugger()
   call RunDbgCmd(buf, 'enew! | only!')
 
   call StopVimInTerminal(buf)
+endfunc
 
+func Test_Debugger_breakadd()
   " Tests for :breakadd file and :breakadd here
   " Breakpoints should be set before sourcing the file
 
@@ -342,10 +344,37 @@ func Test_Debugger()
 
   call delete('Xtest.vim')
   %bw!
+
   call assert_fails('breakadd here', 'E32:')
   call assert_fails('breakadd file Xtest.vim /\)/', 'E55:')
 endfunc
 
+def Test_Debugger_breakadd_expr()
+  var lines =<< trim END
+      vim9script
+      func g:EarlyFunc()
+      endfunc
+      breakadd expr DoesNotExist()
+      func g:LaterFunc()
+      endfunc
+      breakdel *
+  END
+  writefile(lines, 'Xtest.vim')
+
+  # Start Vim in a terminal
+  var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
+  call TermWait(buf)
+
+  # Despite the failure the functions are defined
+  RunDbgCmd(buf, ':function g:EarlyFunc',
+     ['function EarlyFunc()', 'endfunction'], {match: 'pattern'})
+  RunDbgCmd(buf, ':function g:LaterFunc',
+     ['function LaterFunc()', 'endfunction'], {match: 'pattern'})
+
+  call StopVimInTerminal(buf)
+  call delete('Xtest.vim')
+enddef
+
 func Test_Backtrace_Through_Source()
   CheckCWD
   let file1 =<< trim END