diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-01-13 00:19:20 -0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2020-01-18 21:32:14 -0800 |
commit | 156c25e4983d4c106ba70e5e3bcc6bbb012d8065 (patch) | |
tree | 64e89489d61715dc4bfa5f6da3f7211ed43c256d /test/functional/helpers.lua | |
parent | 2b8e66c6ce0a5ccae09023732c06da90f96ed5f5 (diff) | |
download | rneovim-156c25e4983d4c106ba70e5e3bcc6bbb012d8065.tar.gz rneovim-156c25e4983d4c106ba70e5e3bcc6bbb012d8065.tar.bz2 rneovim-156c25e4983d4c106ba70e5e3bcc6bbb012d8065.zip |
WinClosed: sort auevents.lua; improve tests
- test: reduce verbosity, condense redundancy, improve readability
- auevents.lua: keep events sorted by name. ref afd1d412fa91
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r-- | test/functional/helpers.lua | 13 |
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 |