]> granicus.if.org Git - vim/commitdiff
patch 7.4.1877 v7.4.1877
authorBram Moolenaar <Bram@vim.org>
Thu, 2 Jun 2016 17:06:25 +0000 (19:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 2 Jun 2016 17:06:25 +0000 (19:06 +0200)
Problem:    No test for invoking "close_cb" when writing to a buffer.
Solution:   Add using close_cb to a test case.

src/testdir/test_channel.vim
src/version.c

index ed3fa6d4664d4c6a37b40f7f48922e06e0a71abb..b4e9d7f9b09562e4f124e417fd7f259db5ad9c55 100644 (file)
@@ -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, nomod)
     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)
index bc7892345d09a35547452eee546b534df1be148f..aeed59180116e83cfbf00b7ee54903c6813df690 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1877,
 /**/
     1876,
 /**/