mirror of
https://github.com/neovim/neovim.git
synced 2025-11-09 12:05:14 +00:00
server_requests_spec: fix assertion, pass Lua paths via args (#10875)
This makes it pick up the nvim Luarocks module properly when not installed via third-party.
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
local deps_prefix = (os.getenv('DEPS_PREFIX') and os.getenv('DEPS_PREFIX')
|
--- RPC server fixture.
|
||||||
or './.deps/usr')
|
--
|
||||||
|
-- Lua's paths are passed as arguments to reflect the path in the test itself.
|
||||||
package.path = deps_prefix .. '/share/lua/5.1/?.lua;' ..
|
package.path = arg[1]
|
||||||
deps_prefix .. '/share/lua/5.1/?/init.lua;' ..
|
package.cpath = arg[2]
|
||||||
package.path
|
|
||||||
|
|
||||||
package.cpath = deps_prefix .. '/lib/lua/5.1/?.so;' ..
|
|
||||||
package.cpath
|
|
||||||
|
|
||||||
local mpack = require('mpack')
|
local mpack = require('mpack')
|
||||||
local StdioStream = require('nvim.stdio_stream')
|
local StdioStream = require('nvim.stdio_stream')
|
||||||
|
|||||||
@@ -241,10 +241,14 @@ describe('server -> client', function()
|
|||||||
\ 'rpc': v:true
|
\ 'rpc': v:true
|
||||||
\ }
|
\ }
|
||||||
]])
|
]])
|
||||||
meths.set_var("args", {helpers.test_lua_prg,
|
meths.set_var("args", {
|
||||||
'test/functional/api/rpc_fixture.lua'})
|
helpers.test_lua_prg,
|
||||||
|
'test/functional/api/rpc_fixture.lua',
|
||||||
|
package.path,
|
||||||
|
package.cpath,
|
||||||
|
})
|
||||||
jobid = eval("jobstart(g:args, g:job_opts)")
|
jobid = eval("jobstart(g:args, g:job_opts)")
|
||||||
neq(0, 'jobid')
|
neq(0, jobid)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
after_each(function()
|
after_each(function()
|
||||||
@@ -254,7 +258,11 @@ describe('server -> client', function()
|
|||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
it('rpc and text stderr can be combined', function()
|
it('rpc and text stderr can be combined', function()
|
||||||
eq("ok",funcs.rpcrequest(jobid, "poll"))
|
local status, rv = pcall(funcs.rpcrequest, jobid, 'poll')
|
||||||
|
if not status then
|
||||||
|
error(string.format('missing nvim Lua module? (%s)', rv))
|
||||||
|
end
|
||||||
|
eq('ok', rv)
|
||||||
funcs.rpcnotify(jobid, "ping")
|
funcs.rpcnotify(jobid, "ping")
|
||||||
eq({'notification', 'pong', {}}, next_msg())
|
eq({'notification', 'pong', {}}, next_msg())
|
||||||
eq("done!",funcs.rpcrequest(jobid, "write_stderr", "fluff\n"))
|
eq("done!",funcs.rpcrequest(jobid, "write_stderr", "fluff\n"))
|
||||||
|
|||||||
Reference in New Issue
Block a user