summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-15 19:39:43 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-15 19:39:43 +0200
commitc4da113ef98dcfd6f2a088b1693c0317dcb5bf42 (patch)
treebde8ae5c94f11e87cd89fed4e0c94416b830fedf /src/testdir/test_channel.vim
parenta92522fbf3a49d06e08caf010f7d7b0f58d2e131 (diff)
downloadvim-git-c4da113ef98dcfd6f2a088b1693c0317dcb5bf42.tar.gz
patch 8.0.0716: not easy to start Vim cleanlyv8.0.0716
Problem: Not easy to start Vim cleanly without changing the viminfo file. Not possible to know whether the -i command line flag was used. Solution: Add the --clean command line argument. Add the 'viminfofile' option. Add "-u DEFAULTS".
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 3694fc24a..c988968bb 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -739,6 +739,38 @@ func Test_pipe_to_buffer_name_nomsg()
call Run_test_pipe_to_buffer(1, 0, 1)
endfunc
+func Test_close_output_buffer()
+ if !has('job')
+ return
+ endif
+ enew!
+ let test_lines = ['one', 'two']
+ call setline(1, test_lines)
+ call ch_log('Test_close_output_buffer()')
+ let options = {'out_io': 'buffer'}
+ let options['out_name'] = 'buffer-output'
+ let options['out_msg'] = 0
+ split buffer-output
+ let job = job_start(s:python . " test_channel_write.py", options)
+ call assert_equal("run", job_status(job))
+ try
+ call WaitFor('line("$") == 3')
+ call assert_equal(3, line('$'))
+ quit!
+ sleep 100m
+ " Make sure the write didn't happen to the wrong buffer.
+ call assert_equal(test_lines, getline(1, line('$')))
+ call assert_equal(-1, bufwinnr('buffer-output'))
+ sbuf buffer-output
+ call assert_notequal(-1, bufwinnr('buffer-output'))
+ sleep 100m
+ close " no more writes
+ bwipe!
+ finally
+ call job_stop(job)
+ endtry
+endfunc
+
func Run_test_pipe_err_to_buffer(use_name, nomod, do_msg)
if !has('job')
return