aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2020-01-18 22:08:49 -0800
committerGitHub <noreply@github.com>2020-01-18 22:08:49 -0800
commitacaf5d233b9128c4b494cec6ca1bf090dc2f7a56 (patch)
tree5cf9c244ed45ea48d190374042e0476da5ad8fcd /test/functional/helpers.lua
parentfb8b0503baf95ccd9ab4a30220dd08ca8b16736b (diff)
parentb648b38bb1a447c1e757f61ddd248a686cd32807 (diff)
downloadrneovim-acaf5d233b9128c4b494cec6ca1bf090dc2f7a56.tar.gz
rneovim-acaf5d233b9128c4b494cec6ca1bf090dc2f7a56.tar.bz2
rneovim-acaf5d233b9128c4b494cec6ca1bf090dc2f7a56.zip
Merge #11331 'WinClosed autocmd'
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index e0012c6ced..de61ff9cc8 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -597,6 +597,19 @@ function module.assert_alive()
assert(2 == module.eval('1+1'), 'crash? request failed')
end
+-- Asserts that buffer is loaded and visible in the current tabpage.
+function module.assert_visible(bufnr, visible)
+ assert(type(visible) == 'boolean')
+ eq(visible, module.bufmeths.is_loaded(bufnr))
+ if visible then
+ assert(-1 ~= module.funcs.bufwinnr(bufnr),
+ 'expected buffer to be visible in current tabpage: '..tostring(bufnr))
+ else
+ assert(-1 == module.funcs.bufwinnr(bufnr),
+ 'expected buffer NOT visible in current tabpage: '..tostring(bufnr))
+ end
+end
+
local function do_rmdir(path)
local mode, errmsg, errcode = lfs.attributes(path, 'mode')
if mode == nil then