mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
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 #8848)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user