Mercurial > vim
comparison src/testdir/term_util.vim @ 22780:2e681033d766 v8.2.1938
patch 8.2.1938: wiping out a terminal buffer makes some tests fail
Commit: https://github.com/vim/vim/commit/a46765a79745ff27b4a44659fb8389519c961977
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 1 20:58:26 2020 +0100
patch 8.2.1938: wiping out a terminal buffer makes some tests fail
Problem: Wiping out a terminal buffer makes some tests fail.
Solution: Do not wipe out the terminal buffer unless wanted.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 01 Nov 2020 21:00:05 +0100 |
parents | 3ec5f653f64d |
children | 949238ccbd50 |
comparison
equal
deleted
inserted
replaced
22779:b90c404c6c1a | 22780:2e681033d766 |
---|---|
132 | 132 |
133 return buf | 133 return buf |
134 endfunc | 134 endfunc |
135 | 135 |
136 " Stop a Vim running in terminal buffer "buf". | 136 " Stop a Vim running in terminal buffer "buf". |
137 func StopVimInTerminal(buf) | 137 func StopVimInTerminal(buf, kill = 1) |
138 " Using a terminal to run Vim is always considered flaky. | 138 " Using a terminal to run Vim is always considered flaky. |
139 let g:test_is_flaky = 1 | 139 let g:test_is_flaky = 1 |
140 | 140 |
141 call assert_equal("running", term_getstatus(a:buf)) | 141 call assert_equal("running", term_getstatus(a:buf)) |
142 | 142 |
149 | 149 |
150 " Wait for the terminal to end. | 150 " Wait for the terminal to end. |
151 call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))}) | 151 call WaitForAssert({-> assert_equal("finished", term_getstatus(a:buf))}) |
152 | 152 |
153 " If the buffer still exists forcefully wipe it. | 153 " If the buffer still exists forcefully wipe it. |
154 if bufexists(a:buf) | 154 if a:kill && bufexists(a:buf) |
155 exe a:buf .. 'bwipe!' | 155 exe a:buf .. 'bwipe!' |
156 endif | 156 endif |
157 endfunc | 157 endfunc |
158 | 158 |
159 " Open a terminal with a shell, assign the job to g:job and return the buffer | 159 " Open a terminal with a shell, assign the job to g:job and return the buffer |