Fix test now that we're using a mapping
This commit is contained in:
parent
cc84e15932
commit
5a1eb9250a
2 changed files with 23 additions and 21 deletions
|
|
@ -601,10 +601,14 @@ function! Test_VariableEval()
|
||||||
call vimspector#StepOver()
|
call vimspector#StepOver()
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
||||||
|
|
||||||
|
" leader is ,
|
||||||
|
xmap <buffer> <Leader>d <Plug>VimspectorBalloonEval
|
||||||
|
nmap <buffer> <Leader>d <Plug>VimspectorBalloonEval
|
||||||
|
|
||||||
"evaluate the prev line
|
"evaluate the prev line
|
||||||
call setpos('.', [ 0, 24, 8 ])
|
call setpos( '.', [ 0, 24, 8 ] )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
||||||
call vimspector#ShowTooltip()
|
call feedkeys( ',d', 'xt' )
|
||||||
|
|
||||||
call WaitForAssert( {->
|
call WaitForAssert( {->
|
||||||
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
||||||
|
|
@ -633,19 +637,10 @@ function! Test_VariableEval()
|
||||||
\ } )
|
\ } )
|
||||||
|
|
||||||
" test selection
|
" test selection
|
||||||
call setpos('.', [ 0, 24, 8 ])
|
call setpos( '.', [ 0, 24, 8 ] )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
||||||
|
|
||||||
" enter visual mode
|
call feedkeys( 'viw,d', 'xt' )
|
||||||
" this is a hack, since usually, when user enters command mode from inside
|
|
||||||
" visual mode, the latter is immediately interrupted and the '<' '>' marks are
|
|
||||||
" set. for some odd reason, visual mode is not interupted from the script,
|
|
||||||
" so we need to manually escape and re-trigger previous visual selection
|
|
||||||
call execute('normal v')
|
|
||||||
call feedkeys("lllll\<esc>", 'xt')
|
|
||||||
call execute('normal gv')
|
|
||||||
|
|
||||||
call vimspector#ShowTooltipForSelection()
|
|
||||||
|
|
||||||
call WaitForAssert( {->
|
call WaitForAssert( {->
|
||||||
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
||||||
|
|
@ -667,18 +662,19 @@ function! Test_VariableEval()
|
||||||
\ } )
|
\ } )
|
||||||
|
|
||||||
"Close
|
"Close
|
||||||
" we need to send esc twice because of the weird interactions between visual
|
call feedkeys( "\<Esc>", 'xt' )
|
||||||
" mode and tests
|
|
||||||
call feedkeys( "\<Esc>\<Esc>", 'xt' )
|
|
||||||
|
|
||||||
call WaitForAssert( {->
|
call WaitForAssert( {->
|
||||||
\ assert_equal( v:none, g:vimspector_session_windows.eval )
|
\ assert_equal( v:none, g:vimspector_session_windows.eval )
|
||||||
\ } )
|
\ } )
|
||||||
|
|
||||||
|
" Get back to normal mode
|
||||||
|
call feedkeys( "\<Esc>", 'xt' )
|
||||||
|
|
||||||
" Evaluation error
|
" Evaluation error
|
||||||
call setpos('.', [ 0, 25, 1 ])
|
call setpos( '.', [ 0, 25, 1 ] )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 25, 1 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 25, 1 )
|
||||||
call vimspector#ShowTooltip()
|
call feedkeys( ',d', 'xt' )
|
||||||
|
|
||||||
call WaitForAssert( {->
|
call WaitForAssert( {->
|
||||||
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
||||||
|
|
@ -715,10 +711,14 @@ function! Test_VariableEvalExpand()
|
||||||
call vimspector#StepOver()
|
call vimspector#StepOver()
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 26, 1 )
|
||||||
|
|
||||||
|
" leader is ,
|
||||||
|
xmap <buffer> <Leader>d <Plug>VimspectorBalloonEval
|
||||||
|
nmap <buffer> <Leader>d <Plug>VimspectorBalloonEval
|
||||||
|
|
||||||
"evaluate the prev line
|
"evaluate the prev line
|
||||||
call setpos('.', [ 0, 24, 8 ])
|
call setpos( '.', [ 0, 24, 8 ] )
|
||||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 24, 8 )
|
||||||
call vimspector#ShowTooltip()
|
call feedkeys( ',d', 'xt' )
|
||||||
|
|
||||||
call WaitForAssert( {->
|
call WaitForAssert( {->
|
||||||
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
\ assert_notequal( v:none, g:vimspector_session_windows.eval )
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
let g:vimspector_test_plugin_path = expand( '<sfile>:p:h:h' )
|
let g:vimspector_test_plugin_path = expand( '<sfile>:p:h:h' )
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set noequalalways
|
set noequalalways
|
||||||
|
let mapleader = ','
|
||||||
|
let maplocalleader = "\<Space>"
|
||||||
|
|
||||||
let &rtp = &rtp . ',' . g:vimspector_test_plugin_path
|
let &runtimepath = &runtimepath . ',' . g:vimspector_test_plugin_path
|
||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax enable
|
syntax enable
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue