From c4da113ef98dcfd6f2a088b1693c0317dcb5bf42 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 15 Jul 2017 19:39:43 +0200 Subject: patch 8.0.0716: not easy to start Vim cleanly 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". --- src/testdir/test_channel.vim | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/testdir/test_channel.vim') 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 -- cgit v1.2.1