local t = require('test.testutil')
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local fn = n.fn
local api = n.api
local command = n.command
local eq = t.eq
local exec_lua = n.exec_lua
local exec_capture = n.exec_capture
local matches = t.matches
local pcall_err = t.pcall_err
describe('vim._with', function()
before_each(function()
n.clear()
exec_lua([[
_G.fn = vim.fn
_G.api = vim.api
_G.setup_buffers = function()
return api.nvim_create_buf(false, true), api.nvim_get_current_buf()
end
_G.setup_windows = function()
local other_win = api.nvim_get_current_win()
vim.cmd.new()
return other_win, api.nvim_get_current_win()
end
]])
end)
local assert_events_trigger = function()
local out = exec_lua [[
-- Needs three global values defined:
-- - `test_events` - array of events which are tested.
-- - `test_context` - context to be tested.
-- - `test_trig_event` - callable triggering at least one tested event.
_G.n_events = 0
|