mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 7.4.1877
Problem: No test for invoking "close_cb" when writing to a buffer. Solution: Add using close_cb to a test case.
This commit is contained in:
@@ -676,12 +676,17 @@ func Test_nl_write_both_file()
|
|||||||
endtry
|
endtry
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func BufCloseCb(ch)
|
||||||
|
let s:bufClosed = 'yes'
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Run_test_pipe_to_buffer(use_name, nomod)
|
func Run_test_pipe_to_buffer(use_name, nomod)
|
||||||
if !has('job')
|
if !has('job')
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call ch_log('Test_pipe_to_buffer()')
|
call ch_log('Test_pipe_to_buffer()')
|
||||||
let options = {'out_io': 'buffer'}
|
let s:bufClosed = 'no'
|
||||||
|
let options = {'out_io': 'buffer', 'close_cb': 'BufCloseCb'}
|
||||||
if a:use_name
|
if a:use_name
|
||||||
let options['out_name'] = 'pipe-output'
|
let options['out_name'] = 'pipe-output'
|
||||||
let firstline = 'Reading from channel output...'
|
let firstline = 'Reading from channel output...'
|
||||||
@@ -704,15 +709,13 @@ func Run_test_pipe_to_buffer(use_name, nomod)
|
|||||||
call ch_sendraw(handle, "quit\n")
|
call ch_sendraw(handle, "quit\n")
|
||||||
sp pipe-output
|
sp pipe-output
|
||||||
call s:waitFor('line("$") >= 6')
|
call s:waitFor('line("$") >= 6')
|
||||||
if getline('$') == 'DETACH'
|
|
||||||
$del
|
|
||||||
endif
|
|
||||||
call assert_equal([firstline, 'line one', 'line two', 'this', 'AND this', 'Goodbye!'], getline(1, '$'))
|
call assert_equal([firstline, 'line one', 'line two', 'this', 'AND this', 'Goodbye!'], getline(1, '$'))
|
||||||
if a:nomod
|
if a:nomod
|
||||||
call assert_equal(0, &modifiable)
|
call assert_equal(0, &modifiable)
|
||||||
else
|
else
|
||||||
call assert_equal(1, &modifiable)
|
call assert_equal(1, &modifiable)
|
||||||
endif
|
endif
|
||||||
|
call assert_equal('yes', s:bufClosed)
|
||||||
bwipe!
|
bwipe!
|
||||||
finally
|
finally
|
||||||
call job_stop(job)
|
call job_stop(job)
|
||||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1877,
|
||||||
/**/
|
/**/
|
||||||
1876,
|
1876,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user