WinClosed: sort auevents.lua; improve tests

- test: reduce verbosity, condense redundancy, improve readability
- auevents.lua: keep events sorted by name. ref afd1d412fa
This commit is contained in:
Justin M. Keyes
2020-01-13 00:19:20 -08:00
parent 2b8e66c6ce
commit 156c25e498
5 changed files with 105 additions and 101 deletions

View File

@@ -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