changeset 9187:fb1a19011fbe v7.4.1877

commit https://github.com/vim/vim/commit/01d46e41ba4967ee534db4b94ad642007634841e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 2 19:06:25 2016 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 02 Jun 2016 19:15:06 +0200
parents 71a6e5083607
children 6de68608c4ea
files src/testdir/test_channel.vim src/version.c
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -676,12 +676,17 @@ func Test_nl_write_both_file()
   endtry
 endfunc
 
+func BufCloseCb(ch)
+  let s:bufClosed = 'yes'
+endfunc
+
 func Run_test_pipe_to_buffer(use_name, nomod)
   if !has('job')
     return
   endif
   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
     let options['out_name'] = 'pipe-output'
     let firstline = 'Reading from channel output...'
@@ -704,15 +709,13 @@ func Run_test_pipe_to_buffer(use_name, n
     call ch_sendraw(handle, "quit\n")
     sp pipe-output
     call s:waitFor('line("$") >= 6')
-    if getline('$') == 'DETACH'
-      $del
-    endif
     call assert_equal([firstline, 'line one', 'line two', 'this', 'AND this', 'Goodbye!'], getline(1, '$'))
     if a:nomod
       call assert_equal(0, &modifiable)
     else
       call assert_equal(1, &modifiable)
     endif
+    call assert_equal('yes', s:bufClosed)
     bwipe!
   finally
     call job_stop(job)
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1877,
+/**/
     1876,
 /**/
     1875,