mirror of
https://github.com/neovim/neovim.git
synced 2026-04-24 16:25:40 +00:00
vim-patch:partial:9.1.0613: tests: termdebug test may fail and leave file around
Problem: tests: termdebug test may fail and leave temp file around
(Dominique Pellé)
Solution: only run balloon_show() if the function exists, validate
termdebug is running using the g: termdebug_is_running var,
use defer to delete temporary files
Only include:
- guard balloon_show() in the termdebug plugin
- wait for g:termdebug_is_running in Test_termdebug_basic()
The remaining upstream test cleanups do not apply here.
fixes: vim/vim#15334
2979cfc262
Co-authored-by: Christian Brabandt <cb@256bit.org>
AI-assisted: Codex
This commit is contained in:
@@ -63,6 +63,7 @@ func Test_termdebug_basic()
|
||||
|
||||
edit XTD_basic.c
|
||||
Termdebug ./XTD_basic
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
let gdb_buf = winbufnr(1)
|
||||
wincmd b
|
||||
@@ -196,6 +197,7 @@ func Test_termdebug_basic()
|
||||
let g:termdebug_config = {}
|
||||
let g:termdebug_config['use_prompt'] = use_prompt
|
||||
TermdebugCommand ./XTD_basic arg args
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
wincmd t
|
||||
quit!
|
||||
@@ -218,6 +220,7 @@ func Test_termdebug_tbreak()
|
||||
execute 'edit ' .. src_name
|
||||
execute 'Termdebug ./' .. bin_name
|
||||
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
let gdb_buf = winbufnr(1)
|
||||
wincmd b
|
||||
@@ -279,6 +282,7 @@ func Test_termdebug_mapping()
|
||||
call assert_true(maparg('-', 'n', 0, 1)->empty())
|
||||
call assert_true(maparg('+', 'n', 0, 1)->empty())
|
||||
Termdebug
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
wincmd b
|
||||
call assert_false(maparg('K', 'n', 0, 1)->empty())
|
||||
@@ -301,6 +305,7 @@ func Test_termdebug_mapping()
|
||||
nnoremap - :echom "-"<cr>
|
||||
nnoremap + :echom "+"<cr>
|
||||
Termdebug
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
wincmd b
|
||||
call assert_false(maparg('K', 'n', 0, 1)->empty())
|
||||
@@ -338,6 +343,7 @@ func Test_termdebug_mapping()
|
||||
" Start termdebug from foo
|
||||
buffer foo
|
||||
Termdebug
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
wincmd b
|
||||
call assert_true(maparg('K', 'n', 0, 1).buffer)
|
||||
@@ -440,6 +446,7 @@ function Test_termdebug_save_restore_variables()
|
||||
let g:termdebug_config['map_K'] = 1
|
||||
|
||||
Termdebug
|
||||
call WaitForAssert({-> assert_true(get(g:, "termdebug_is_running", v:false))})
|
||||
call WaitForAssert({-> assert_equal(3, winnr('$'))})
|
||||
call WaitForAssert({-> assert_match(&mousemodel, 'popup_setpos')})
|
||||
wincmd t
|
||||
|
||||
Reference in New Issue
Block a user