forked from puremourning/vimspector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoto.test.vim
90 lines (73 loc) · 2.88 KB
/
goto.test.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
function! SetUp()
call vimspector#test#setup#SetUpWithMappings( v:null )
endfunction
function! TearDown()
call vimspector#test#setup#TearDown()
endfunction
function! Test_GoTo_Single()
lcd ../support/test/python/simple_python
edit main.py
call vimspector#SetLineBreakpoint( 'main.py', 26 )
call vimspector#LaunchWithSettings( { 'configuration': 'run' } )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 26, 1 )
call vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 26 )
call cursor( 23, 1 )
call vimspector#GoToCurrentLine()
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 23, 1 )
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 23 ) } )
call cursor( 25, 1 )
call vimspector#GoToCurrentLine()
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 25, 1 )
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 25 ) } )
call vimspector#test#setup#Reset()
lcd -
%bwipe!
endfunction
function! Test_GoTo_Single_Mapping()
lcd ../support/test/python/simple_python
edit main.py
call vimspector#SetLineBreakpoint( 'main.py', 26 )
call vimspector#LaunchWithSettings( { 'configuration': 'run' } )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 26, 1 )
call vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 26 )
call cursor( 23, 1 )
nmap <Leader>g <Plug>VimspectorGoToCurrentLine
execute 'normal ,g'
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 23, 1 )
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 23 ) } )
call cursor( 25, 1 )
call vimspector#GoToCurrentLine()
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 25, 1 )
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 25 ) } )
call vimspector#test#setup#Reset()
silent! nunmap <Leader>g
lcd -
%bwipe!
endfunction
function! Test_GoTo_FailsGoTo()
lcd ../support/test/python/simple_python
edit main.py
call vimspector#SetLineBreakpoint( 'main.py', 23 )
call vimspector#LaunchWithSettings( { 'configuration': 'run' } )
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( 'main.py', 23, 1 )
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 23 ) } )
call cursor( 15, 10 )
call vimspector#GoToCurrentLine()
sleep 100m
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 23 ) } )
call vimspector#StepOver()
call WaitForAssert( { ->
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( 'main.py', 25 ) } )
call vimspector#test#setup#Reset()
lcd -
%bwipe!
endfunction
function! Test_GoTo_Multiple()
" TODO: Can't seem to find any adapters that actually support multiple
endfunction