Finally fix breakpoint bugs

This commit is contained in:
Ben Jackson 2019-07-23 22:45:35 +01:00
commit 1e54e457d4
5 changed files with 63 additions and 28 deletions

View file

@ -182,14 +182,25 @@ function Test_DisableBreakpointWhileDebugging()
" Remove the breakpoint
call feedkeys( "\<F9>", 'xt' )
call vimspector#test#signs#AssertSignGroupEmptyAtLine( 'VimspectorCode', 16 )
call WaitForAssert( {->
\ vimspector#test#signs#AssertSignGroupEmptyAtLine( 'VimspectorCode',
\ 16 )
\ } )
" Add the breakpoint
call feedkeys( "\<F9>", 'xt' )
call vimspector#test#signs#AssertSignGroupSingletonAtLine(
\ 'VimspectorCode',
\ 16,
\ 'vimspectorBP' )
call WaitForAssert( {->
\ vimspector#test#signs#AssertSignGroupSingletonAtLine(
\ 'VimspectorCode',
\ 16,
\ 'vimspectorBP' )
\ } )
" Run to breakpoint
call setpos( '.', [ 0, 15, 1 ] )
call feedkeys( "\<F5>", 'xt' )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'simple.cpp', 16, 1 )
call vimspector#test#signs#AssertPCIsAtLineInBuffer( 'simple.cpp', 16 )
call vimspector#Reset()
call WaitForAssert( {->

View file

@ -46,10 +46,10 @@ function! vimspector#test#signs#AssertSignGroupSingletonAtLine( group,
return assert_equal( 1,
\ len( signs ),
\ 'Num buffers named %' ) &&
\ 'Num buffers named %' ) ||
\ assert_equal( 1,
\ len( signs[ 0 ].signs ),
\ 'Num signs in ' . a:group . ' at ' . a:line ) &&
\ 'Num signs in ' . a:group . ' at ' . a:line ) ||
\ assert_equal( a:sign_name,
\ signs[ 0 ].signs[ 0 ].name,
\ 'Sign in group ' . a:group . ' at ' . a:line )
@ -64,7 +64,7 @@ function! vimspector#test#signs#AssertSignGroupEmptyAtLine( group, line ) abort
return assert_equal( 1,
\ len( signs ),
\ 'Num buffers named %' ) &&
\ 'Num buffers named %' ) ||
\ assert_equal( 0,
\ len( signs[ 0 ].signs ),
\ 'Num signs in ' . a:group . ' at ' . a:line )
@ -77,7 +77,7 @@ function! vimspector#test#signs#AssertSignGroupEmpty( group ) abort
\ } )
return assert_equal( 1,
\ len( signs ),
\ 'Num buffers named %' ) &&
\ 'Num buffers named %' ) ||
\ assert_equal( 0,
\ len( signs[ 0 ].signs ),
\ 'Num signs in ' . a:group )

View file

@ -116,6 +116,11 @@ func RunTheTest(test)
try
let s:test = a:test
let s:testid = g:testpath . ':' . a:test
let test_filesafe = substitute( a:test, ')', '_', 'g' )
let test_filesafe = substitute( test_filesafe, '(', '_', 'g' )
let test_filesafe = substitute( test_filesafe, ',', '_', 'g' )
let test_filesafe = substitute( test_filesafe, ':', '_', 'g' )
let s:testid_filesafe = g:testpath . '_' . test_filesafe
au VimLeavePre * call EarlyExit(s:test)
exe 'call ' . a:test
au! VimLeavePre
@ -203,7 +208,7 @@ func AfterTheTest()
let v:errors = []
let log = readfile( expand( '~/.vimspector.log' ) )
let logfile = s:testid . '.vimspector.log'
let logfile = s:testid_filesafe . '.vimspector.log'
call writefile( log, logfile, 's' )
call add( s:messages, 'Wrote log for failed test: ' . logfile )
endif