Mercurial > vim
comparison src/testdir/test_channel.vim @ 20158:94f05de75e9f v8.2.0634
patch 8.2.0634: crash with null partial and blob
Commit: https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 25 15:24:44 2020 +0200
patch 8.2.0634: crash with null partial and blob
Problem: Crash with null partial and blob.
Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan,
closes #5984)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Apr 2020 15:30:04 +0200 |
parents | 49694eceaa55 |
children | 2fb397573541 |
comparison
equal
deleted
inserted
replaced
20157:ada5332a22b7 | 20158:94f05de75e9f |
---|---|
1137 let job = job_start(s:python . " test_channel_pipe.py something", | 1137 let job = job_start(s:python . " test_channel_pipe.py something", |
1138 \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'}) | 1138 \ {'in_io': 'null', 'out_io': 'null', 'err_io': 'null'}) |
1139 call assert_equal("run", job_status(job)) | 1139 call assert_equal("run", job_status(job)) |
1140 call assert_equal('channel fail', string(job_getchannel(job))) | 1140 call assert_equal('channel fail', string(job_getchannel(job))) |
1141 call assert_equal('fail', ch_status(job)) | 1141 call assert_equal('fail', ch_status(job)) |
1142 call assert_equal('no process', string(test_null_job())) | |
1143 call assert_equal('channel fail', string(test_null_channel())) | |
1142 call job_stop(job) | 1144 call job_stop(job) |
1143 endfunc | 1145 endfunc |
1144 | 1146 |
1145 func Test_pipe_to_buffer_raw() | 1147 func Test_pipe_to_buffer_raw() |
1146 let options = {'out_mode': 'raw', 'out_io': 'buffer', 'out_name': 'testout'} | 1148 let options = {'out_mode': 'raw', 'out_io': 'buffer', 'out_name': 'testout'} |
1704 func Test_partial_in_channel_cycle() | 1706 func Test_partial_in_channel_cycle() |
1705 let d = {} | 1707 let d = {} |
1706 let d.a = function('string', [d]) | 1708 let d.a = function('string', [d]) |
1707 try | 1709 try |
1708 let d.b = ch_open('nowhere:123', {'close_cb': d.a}) | 1710 let d.b = ch_open('nowhere:123', {'close_cb': d.a}) |
1711 call test_garbagecollect_now() | |
1709 catch | 1712 catch |
1710 call assert_exception('E901:') | 1713 call assert_exception('E901:') |
1711 endtry | 1714 endtry |
1712 unlet d | 1715 unlet d |
1713 endfunc | 1716 endfunc |
1891 call assert_report("Can't open channel") | 1894 call assert_report("Can't open channel") |
1892 return | 1895 return |
1893 endif | 1896 endif |
1894 let g:Ch_close_ret = '' | 1897 let g:Ch_close_ret = '' |
1895 call ch_setoptions(handle, {'close_cb': {ch -> execute("let g:Ch_close_ret = 'closed'")}}) | 1898 call ch_setoptions(handle, {'close_cb': {ch -> execute("let g:Ch_close_ret = 'closed'")}}) |
1899 call test_garbagecollect_now() | |
1896 | 1900 |
1897 call assert_equal('', ch_evalexpr(handle, 'close me')) | 1901 call assert_equal('', ch_evalexpr(handle, 'close me')) |
1898 call WaitForAssert({-> assert_equal('closed', g:Ch_close_ret)}) | 1902 call WaitForAssert({-> assert_equal('closed', g:Ch_close_ret)}) |
1899 endfunc | 1903 endfunc |
1900 | 1904 |