Mercurial > vim
comparison src/testdir/test_channel.vim @ 20156:49694eceaa55 v8.2.0633
patch 8.2.0633: crash when using null partial in filter()
Commit: https://github.com/vim/vim/commit/9d8d0b5c644ea53364d04403740b3f23e57c1497
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 24 22:47:31 2020 +0200
patch 8.2.0633: crash when using null partial in filter()
Problem: Crash when using null partial in filter().
Solution: Fix crash. Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5976)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 24 Apr 2020 23:00:04 +0200 |
parents | 16460964c304 |
children | 94f05de75e9f |
comparison
equal
deleted
inserted
replaced
20155:f413c0207fd1 | 20156:49694eceaa55 |
---|---|
1201 \ {'out_cb': dict.outHandler, | 1201 \ {'out_cb': dict.outHandler, |
1202 \ 'out_mode': 'json', | 1202 \ 'out_mode': 'json', |
1203 \ 'err_cb': dict.errHandler, | 1203 \ 'err_cb': dict.errHandler, |
1204 \ 'err_mode': 'json'}) | 1204 \ 'err_mode': 'json'}) |
1205 call assert_equal("run", job_status(job)) | 1205 call assert_equal("run", job_status(job)) |
1206 call test_garbagecollect_now() | |
1206 try | 1207 try |
1207 let g:Ch_outmsg = '' | 1208 let g:Ch_outmsg = '' |
1208 let g:Ch_errmsg = '' | 1209 let g:Ch_errmsg = '' |
1209 call ch_sendraw(job, "echo [0, \"hello\"]\n") | 1210 call ch_sendraw(job, "echo [0, \"hello\"]\n") |
1210 call ch_sendraw(job, "echoerr [0, \"there\"]\n") | 1211 call ch_sendraw(job, "echoerr [0, \"there\"]\n") |
1816 endfunc | 1817 endfunc |
1817 | 1818 |
1818 let g:out = '' | 1819 let g:out = '' |
1819 let arg = 'import sys;sys.stdout.write("1\n2\n3")' | 1820 let arg = 'import sys;sys.stdout.write("1\n2\n3")' |
1820 call job_start([s:python, '-c', arg], {'close_cb': function('s:close_cb')}) | 1821 call job_start([s:python, '-c', arg], {'close_cb': function('s:close_cb')}) |
1822 call test_garbagecollect_now() | |
1821 call WaitForAssert({-> assert_equal('123', g:out)}) | 1823 call WaitForAssert({-> assert_equal('123', g:out)}) |
1822 unlet g:out | 1824 unlet g:out |
1823 delfunc s:close_cb | 1825 delfunc s:close_cb |
1824 endfunc | 1826 endfunc |
1825 | 1827 |
1826 func Test_read_from_terminated_job() | 1828 func Test_read_from_terminated_job() |
1827 let g:linecount = 0 | 1829 let g:linecount = 0 |
1828 let arg = 'import os,sys;os.close(1);sys.stderr.write("test\n")' | 1830 let arg = 'import os,sys;os.close(1);sys.stderr.write("test\n")' |
1829 call job_start([s:python, '-c', arg], {'callback': {-> execute('let g:linecount += 1')}}) | 1831 call job_start([s:python, '-c', arg], {'callback': {-> execute('let g:linecount += 1')}}) |
1830 call WaitForAssert({-> assert_equal(1, g:linecount)}) | 1832 call WaitForAssert({-> assert_equal(1, g:linecount)}) |
1833 call test_garbagecollect_now() | |
1831 unlet g:linecount | 1834 unlet g:linecount |
1832 endfunc | 1835 endfunc |
1833 | 1836 |
1834 func Test_job_start_windows() | 1837 func Test_job_start_windows() |
1835 CheckMSWindows | 1838 CheckMSWindows |