comparison src/testdir/test_channel.vim @ 19724:b3e93a05c3ca v8.2.0418

patch 8.2.0418: code in eval.c not sufficiently covered by tests Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 20 18:20:51 2020 +0100 patch 8.2.0418: code in eval.c not sufficiently covered by tests Problem: Code in eval.c not sufficiently covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 Mar 2020 18:30:05 +0100
parents e73167dd8cac
children 607e5d7968b9
comparison
equal deleted inserted replaced
19723:16aa117306ec 19724:b3e93a05c3ca
516 if j == job 516 if j == job
517 let found += 1 517 let found += 1
518 endif 518 endif
519 endfor 519 endfor
520 call assert_equal(1, found) 520 call assert_equal(1, found)
521
522 " Try to use the job and channel where a number is expected. This is not
523 " related to testing the raw pipe. This test is here just to reuse the
524 " already created job/channel.
525 let ch = job_getchannel(job)
526 call assert_fails('let i = job + 1', 'E910:')
527 call assert_fails('let j = ch + 1', 'E913:')
528 call assert_fails('echo 2.0 == job', 'E911:')
529 call assert_fails('echo 2.0 == ch', 'E914:')
521 endfunc 530 endfunc
522 531
523 func Test_raw_pipe_blob() 532 func Test_raw_pipe_blob()
524 " Add a dummy close callback to avoid that messages are dropped when calling 533 " Add a dummy close callback to avoid that messages are dropped when calling
525 " ch_canread(). 534 " ch_canread().
2023 let l:job = job_start([&shell, &shellcmdflag, has('win32') ? 'echo %VAR1% %VAR2%' : 'echo $VAR1 $VAR2'], {'env': {'VAR1': 'local', 'VAR2': 'local'}, 'callback': 'Ch_handler'}) 2032 let l:job = job_start([&shell, &shellcmdflag, has('win32') ? 'echo %VAR1% %VAR2%' : 'echo $VAR1 $VAR2'], {'env': {'VAR1': 'local', 'VAR2': 'local'}, 'callback': 'Ch_handler'})
2024 let g:Ch_job = l:job 2033 let g:Ch_job = l:job
2025 call WaitForAssert({-> assert_equal("local local", trim(g:Ch_reply))}) 2034 call WaitForAssert({-> assert_equal("local local", trim(g:Ch_reply))})
2026 unlet $VAR1 2035 unlet $VAR1
2027 endfunc 2036 endfunc
2037
2038 " vim: shiftwidth=2 sts=2 expandtab