Minor improvements to console usage

Display failures and stop adding random text which makes the (very
useful) CodeLLDB interface look messy
This commit is contained in:
Ben Jackson 2020-10-10 16:04:55 +01:00
commit 1b9763a4fc
4 changed files with 63 additions and 10 deletions

View file

@ -499,7 +499,7 @@ function Test_EvaluateConsole()
call WaitForAssert( {->
\ assert_equal(
\ [
\ ' Result: 1'
\ '1'
\ ],
\ getbufline( bufnr( 'vimspector.Console' ), '$', '$' )
\ )
@ -511,7 +511,7 @@ function Test_EvaluateConsole()
\ assert_equal(
\ [
\ 'Evaluating: t.i',
\ ' Result: 1'
\ '1'
\ ],
\ getbufline( bufnr( 'vimspector.Console' ), len-1, '$' )
\ )
@ -522,3 +522,49 @@ function Test_EvaluateConsole()
call vimspector#test#setup#Reset()
%bwipe!
endfunction
function Test_EvaluatePromptConsole()
let fn = 'testdata/cpp/simple/struct.cpp'
call s:StartDebugging( #{ fn: fn, line: 24, col: 1, launch: #{
\ configuration: 'run-to-breakpoint'
\ } } )
" Make sure the Test t is initialised
call vimspector#StepOver()
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
call vimspector#StepOver()
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 27, 1 )
VimspectorShowOutput
call assert_equal( bufnr( 'vimspector.Console' ),
\ winbufnr( g:vimspector_session_windows.output ) )
call feedkeys( "it.i\<CR>", 'xt' )
call WaitForAssert( {->
\ assert_equal(
\ [
\ '1'
\ ],
\ getbufline( bufnr( 'vimspector.Console' ), '$', '$' )
\ )
\ } )
let len = getbufinfo( 'vimspector.Console' )[ 0 ].linecount
call WaitForAssert( {->
\ assert_equal(
\ [
\ '> t.i',
\ '',
\ '1'
\ ],
\ getbufline( bufnr( 'vimspector.Console' ), len-2, '$' )
\ )
\ } )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer(
\ 'vimspector.Console', len, v:null )
call vimspector#test#setup#Reset()
%bwipe!
endfunction