vim-patch:9.0.1811: still some issues with term_debug test

Problem:  still some issues with term_debug test
Solution: Use WaitForAssert()

closes: vim/vim#12936

85c3a5bc26

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq 2023-11-09 06:59:36 +08:00
parent 4d36892191
commit 7b921c5501

View File

@ -1,5 +1,6 @@
" Test for the termdebug plugin " Test for the termdebug plugin
source shared.vim
source check.vim source check.vim
CheckUnix CheckUnix
@ -50,7 +51,7 @@ func Test_termdebug_basic()
edit XTD_basic.c edit XTD_basic.c
Termdebug ./XTD_basic Termdebug ./XTD_basic
call assert_equal(3, winnr('$')) call WaitForAssert({-> assert_equal(3, winnr('$'))})
let gdb_buf = winbufnr(1) let gdb_buf = winbufnr(1)
wincmd b wincmd b
Break 9 Break 9
@ -63,21 +64,22 @@ func Test_termdebug_basic()
Run Run
call Nterm_wait(gdb_buf, 400) call Nterm_wait(gdb_buf, 400)
redraw! redraw!
call assert_equal([ call WaitForAssert({-> assert_equal([
\ {'lnum': 9, 'id': 12, 'name': 'debugPC', 'priority': 110, \ {'lnum': 9, 'id': 12, 'name': 'debugPC', 'priority': 110,
\ 'group': 'TermDebug'}, \ 'group': 'TermDebug'},
\ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0', \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
\ 'priority': 110, 'group': 'TermDebug'}], \ 'priority': 110, 'group': 'TermDebug'}],
\ sign_getplaced('', #{group: 'TermDebug'})[0].signs) "\ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
\ sign_getplaced('', #{group: 'TermDebug'})[0].signs->reverse())})
Finish Finish
call Nterm_wait(gdb_buf) call Nterm_wait(gdb_buf)
redraw! redraw!
call assert_equal([ call WaitForAssert({-> assert_equal([
\ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0', \ {'lnum': 9, 'id': 1014, 'name': 'debugBreakpoint1.0',
\ 'priority': 110, 'group': 'TermDebug'}, \ 'priority': 110, 'group': 'TermDebug'},
\ {'lnum': 20, 'id': 12, 'name': 'debugPC', \ {'lnum': 20, 'id': 12, 'name': 'debugPC',
\ 'priority': 110, 'group': 'TermDebug'}], \ 'priority': 110, 'group': 'TermDebug'}],
\ sign_getplaced('', #{group: 'TermDebug'})[0].signs) \ sign_getplaced('', #{group: 'TermDebug'})[0].signs)})
Continue Continue
wincmd t wincmd t
quit! quit!