comparison src/testdir/test_channel.vim @ 8455:d0717262d802 v7.4.1518

commit https://github.com/vim/vim/commit/f65333c9b59654a70f2a07200f65c93dfcaa49b3 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 8 18:27:21 2016 +0100 patch 7.4.1518 Problem: Channel with disconnected in/out/err is not supported. Solution: Implement it for Unix.
author Christian Brabandt <cb@256bit.org>
date Tue, 08 Mar 2016 18:30:05 +0100
parents 3d567b5839c5
children 20533e3de373
comparison
equal deleted inserted replaced
8454:41802f51dbb4 8455:d0717262d802
782 finally 782 finally
783 call job_stop(job) 783 call job_stop(job)
784 endtry 784 endtry
785 endfunc 785 endfunc
786 786
787 func Test_pipe_null()
788 if !has('job')
789 return
790 endif
791 " TODO: implement this for MS-Windows
792 if !has('unix')
793 return
794 endif
795 call ch_log('Test_pipe_null()')
796
797 " We cannot check that no I/O works, we only check that the job starts
798 " properly.
799 let job = job_start(s:python . " test_channel_pipe.py something",
800 \ {'in-io': 'null'})
801 call assert_equal("run", job_status(job))
802 try
803 call assert_equal('something', ch_read(job))
804 finally
805 call job_stop(job)
806 endtry
807
808 let job = job_start(s:python . " test_channel_pipe.py err-out",
809 \ {'out-io': 'null'})
810 call assert_equal("run", job_status(job))
811 try
812 call assert_equal('err-out', ch_read(job, {"part": "err"}))
813 finally
814 call job_stop(job)
815 endtry
816
817 let job = job_start(s:python . " test_channel_pipe.py something",
818 \ {'err-io': 'null'})
819 call assert_equal("run", job_status(job))
820 try
821 call assert_equal('something', ch_read(job))
822 finally
823 call job_stop(job)
824 endtry
825
826 let job = job_start(s:python . " test_channel_pipe.py something",
827 \ {'out-io': 'null', 'err-io': 'out'})
828 call assert_equal("run", job_status(job))
829 call job_stop(job)
830
831 let job = job_start(s:python . " test_channel_pipe.py something",
832 \ {'in-io': 'null', 'out-io': 'null', 'err-io': 'null'})
833 call assert_equal("run", job_status(job))
834 call assert_equal('channel fail', string(job_getchannel(job)))
835 call assert_equal('fail', ch_status(job))
836 call job_stop(job)
837 endfunc
838
787 """""""""" 839 """"""""""
788 840
789 let s:unletResponse = '' 841 let s:unletResponse = ''
790 func s:UnletHandler(handle, msg) 842 func s:UnletHandler(handle, msg)
791 let s:unletResponse = a:msg 843 let s:unletResponse = a:msg