mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
commit
78a2bbaa4b
@ -27,12 +27,8 @@ func Test_client_server()
|
||||
|
||||
let name = 'XVIMTEST'
|
||||
let cmd .= ' --servername ' . name
|
||||
let g:job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'})
|
||||
call WaitFor('job_status(g:job) == "run"')
|
||||
if job_status(g:job) != 'run'
|
||||
call assert_report('Cannot run the Vim server')
|
||||
return
|
||||
endif
|
||||
let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'})
|
||||
call WaitFor({-> job_status(job) == "run"})
|
||||
|
||||
" Takes a short while for the server to be active.
|
||||
" When using valgrind it takes much longer.
|
||||
@ -83,7 +79,7 @@ func Test_client_server()
|
||||
call remote_send(name, ":call server2client(expand('<client>'), 'another')\<CR>", 'g:myserverid')
|
||||
let peek_result = 'nothing'
|
||||
let r = remote_peek(g:myserverid, 'peek_result')
|
||||
" unpredictable whether the result is already avaialble.
|
||||
" unpredictable whether the result is already available.
|
||||
if r > 0
|
||||
call assert_equal('another', peek_result)
|
||||
elseif r == 0
|
||||
@ -97,11 +93,14 @@ func Test_client_server()
|
||||
call assert_equal('another', remote_read(g:myserverid, 2))
|
||||
|
||||
call remote_send(name, ":qa!\<CR>")
|
||||
call WaitFor('job_status(g:job) == "dead"')
|
||||
if job_status(g:job) != 'dead'
|
||||
call assert_report('Server did not exit')
|
||||
call job_stop(g:job, 'kill')
|
||||
endif
|
||||
try
|
||||
call WaitFor({-> job_status(job) == "dead"})
|
||||
finally
|
||||
if job_status(job) != 'dead'
|
||||
call assert_report('Server did not exit')
|
||||
call job_stop(job, 'kill')
|
||||
endif
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
" Uncomment this line to get a debugging log
|
||||
|
@ -669,27 +669,31 @@ func Test_popup_and_window_resize()
|
||||
if h < 15
|
||||
return
|
||||
endif
|
||||
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3})
|
||||
call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>")
|
||||
call term_wait(g:buf, 200)
|
||||
call term_sendkeys(g:buf, "Gi\<c-x>")
|
||||
call term_sendkeys(g:buf, "\<c-v>")
|
||||
call term_wait(g:buf, 100)
|
||||
let rows = h / 3
|
||||
let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': rows})
|
||||
call term_sendkeys(buf, (h / 3 - 1) . "o\<esc>")
|
||||
" Wait for the nested Vim to exit insert mode, where it will show the ruler.
|
||||
" Need to trigger a redraw.
|
||||
call WaitFor({-> execute("redraw") == "" && term_getline(buf, rows) =~ '\<' . rows . ',.*Bot'})
|
||||
|
||||
call term_sendkeys(buf, "Gi\<c-x>")
|
||||
call term_sendkeys(buf, "\<c-v>")
|
||||
call term_wait(buf, 100)
|
||||
" popup first entry "!" must be at the top
|
||||
call WaitFor('term_getline(g:buf, 1) =~ "^!"')
|
||||
call assert_match('^!\s*$', term_getline(g:buf, 1))
|
||||
call WaitFor({-> term_getline(buf, 1) =~ "^!"})
|
||||
call assert_match('^!\s*$', term_getline(buf, 1))
|
||||
exe 'resize +' . (h - 1)
|
||||
call term_wait(g:buf, 100)
|
||||
call term_wait(buf, 100)
|
||||
redraw!
|
||||
" popup shifted down, first line is now empty
|
||||
call WaitFor('term_getline(g:buf, 1) == ""')
|
||||
call assert_equal('', term_getline(g:buf, 1))
|
||||
call WaitFor({-> term_getline(buf, 1) == ""})
|
||||
call assert_equal('', term_getline(buf, 1))
|
||||
sleep 100m
|
||||
" popup is below cursor line and shows first match "!"
|
||||
call WaitFor('term_getline(g:buf, term_getcursor(g:buf)[0] + 1) =~ "^!"')
|
||||
call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1))
|
||||
call WaitFor({-> term_getline(buf, term_getcursor(buf)[0] + 1) =~ "^!"})
|
||||
call assert_match('^!\s*$', term_getline(buf, term_getcursor(buf)[0] + 1))
|
||||
" cursor line also shows !
|
||||
call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0]))
|
||||
call assert_match('^!\s*$', term_getline(buf, term_getcursor(buf)[0]))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
@ -60,12 +60,8 @@ func Do_test_quotestar_for_x11()
|
||||
call assert_notmatch(name, serverlist())
|
||||
|
||||
let cmd .= ' --servername ' . name
|
||||
let g:job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'})
|
||||
call WaitFor('job_status(g:job) == "run"')
|
||||
if job_status(g:job) != 'run'
|
||||
call assert_report('Cannot run the Vim server')
|
||||
return ''
|
||||
endif
|
||||
let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'})
|
||||
call WaitFor({-> job_status(job) == "run"})
|
||||
|
||||
" Takes a short while for the server to be active.
|
||||
call WaitFor('serverlist() =~ "' . name . '"')
|
||||
@ -123,11 +119,14 @@ func Do_test_quotestar_for_x11()
|
||||
endif
|
||||
|
||||
call remote_send(name, ":qa!\<CR>")
|
||||
call WaitFor('job_status(g:job) == "dead"')
|
||||
if job_status(g:job) != 'dead'
|
||||
call assert_report('Server did not exit')
|
||||
call job_stop(g:job, 'kill')
|
||||
endif
|
||||
try
|
||||
call WaitFor({-> job_status(job) == "dead"})
|
||||
finally
|
||||
if job_status(job) != 'dead'
|
||||
call assert_report('Server did not exit')
|
||||
call job_stop(job, 'kill')
|
||||
endif
|
||||
endtry
|
||||
|
||||
return ''
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user