aboutsummaryrefslogtreecommitdiff
path: root/test/client/session.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-01-03 18:39:42 +0100
committerJustin M. Keyes <justinkz@gmail.com>2025-01-03 19:24:04 +0100
commit700a25e6218e016b5adb0ddee740be4618d717a2 (patch)
tree7d068e82e41e44e3325fef63a6a7342234dc900a /test/client/session.lua
parenta1ba655dee0f89230ea09712e4df981cc3b15bea (diff)
downloadrneovim-700a25e6218e016b5adb0ddee740be4618d717a2.tar.gz
rneovim-700a25e6218e016b5adb0ddee740be4618d717a2.tar.bz2
rneovim-700a25e6218e016b5adb0ddee740be4618d717a2.zip
test: include stderr in EOF failure message
Diffstat (limited to 'test/client/session.lua')
-rw-r--r--test/client/session.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/client/session.lua b/test/client/session.lua
index 5b7f1a7caa..a5839e012a 100644
--- a/test/client/session.lua
+++ b/test/client/session.lua
@@ -12,10 +12,8 @@ local RpcStream = require('test.client.rpc_stream')
--- @field private _rpc_stream test.RpcStream
--- @field private _prepare uv.uv_prepare_t
--- @field private _timer uv.uv_timer_t
---- @field exec_lua_setup boolean
--- @field private _is_running boolean true during `Session:run()` scope.
---- @field private _stdout_buffer string[] Stores stdout chunks
---- @field public stdout string Full stdout after the process exits
+--- @field exec_lua_setup boolean
local Session = {}
Session.__index = Session
if package.loaded['jit'] then
@@ -231,7 +229,13 @@ function Session:_run(request_cb, notification_cb, timeout)
end
self._rpc_stream:read_start(request_cb, notification_cb, function()
uv.stop()
- self.eof_err = { 1, 'EOF was received from Nvim. Likely the Nvim process crashed.' }
+
+ --- @diagnostic disable-next-line: invisible
+ local stderr = self._rpc_stream._stream.stderr --[[@as string?]]
+ -- See if `ProcStream.stderr` has anything useful.
+ stderr = '' ~= ((stderr or ''):match('^%s*(.*%S)') or '') and ' stderr:\n' .. stderr or ''
+
+ self.eof_err = { 1, 'EOF was received from Nvim. Likely the Nvim process crashed.' .. stderr }
end)
uv.run()
self._prepare:stop()