vim-patch:8.2.4883: string interpolation only works in heredoc

Problem:    String interpolation only works in heredoc.
Solution:   Support interpolated strings.  Use syntax for heredoc consistent
            with strings, similar to C#. (closes vim/vim#10327)

2eaef106e4

Cherry-pick Test_Debugger_breakadd_expr() from Vim.

Co-authored-by: LemonBoy <thatlemon@gmail.com>
This commit is contained in:
zeertzjq
2023-04-14 21:08:00 +08:00
parent 2cf8f01e7d
commit bacb5021d4
7 changed files with 236 additions and 57 deletions

View File

@@ -348,6 +348,39 @@ func Test_Debugger_breakadd()
call assert_fails('breakadd file Xtest.vim /\)/', 'E55:')
endfunc
" Test for expression breakpoint set using ":breakadd expr <expr>"
func Test_Debugger_breakadd_expr()
CheckRunVimInTerminal
let lines =<< trim END
let g:Xtest_var += 1
END
call writefile(lines, 'Xtest.vim')
" Start Vim in a terminal
let buf = RunVimInTerminal('Xtest.vim', {})
call RunDbgCmd(buf, ':let g:Xtest_var = 10')
call RunDbgCmd(buf, ':breakadd expr g:Xtest_var')
call RunDbgCmd(buf, ':source %')
let expected =<< eval trim END
Oldval = "10"
Newval = "11"
{fnamemodify('Xtest.vim', ':p')}
line 1: let g:Xtest_var += 1
END
call RunDbgCmd(buf, ':source %', expected)
call RunDbgCmd(buf, 'cont')
let expected =<< eval trim END
Oldval = "11"
Newval = "12"
{fnamemodify('Xtest.vim', ':p')}
line 1: let g:Xtest_var += 1
END
call RunDbgCmd(buf, ':source %', expected)
call StopVimInTerminal(buf)
call delete('Xtest.vim')
endfunc
func Test_Backtrace_Through_Source()
CheckRunVimInTerminal
CheckCWD