mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	test: helpers.lua: add temporary set_session() function
This function is needed until helpers.lua is refactored to support multiple sessions.
This commit is contained in:
		@@ -18,6 +18,10 @@ if nvim_dir == nvim_prog then
 | 
			
		||||
    nvim_dir = "."
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Nvim "Unit Under Test" http://en.wikipedia.org/wiki/Device_under_test
 | 
			
		||||
local NvimUUT = {}
 | 
			
		||||
NvimUUT.__index = NvimUUT
 | 
			
		||||
 | 
			
		||||
local prepend_argv
 | 
			
		||||
 | 
			
		||||
if os.getenv('VALGRIND') then
 | 
			
		||||
@@ -49,6 +53,10 @@ end
 | 
			
		||||
 | 
			
		||||
local session, loop_running, loop_stopped, last_error
 | 
			
		||||
 | 
			
		||||
local function set_session(s)
 | 
			
		||||
  session = s
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function request(method, ...)
 | 
			
		||||
  local status, rv = session:request(method, ...)
 | 
			
		||||
  if not status then
 | 
			
		||||
@@ -305,5 +313,6 @@ return {
 | 
			
		||||
  curwin = curwin,
 | 
			
		||||
  curtab = curtab,
 | 
			
		||||
  curbuf_contents = curbuf_contents,
 | 
			
		||||
  wait = wait
 | 
			
		||||
  wait = wait,
 | 
			
		||||
  set_session = set_session
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user