aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-07-25 19:02:39 +0800
committerGitHub <noreply@github.com>2023-07-25 19:02:39 +0800
commitc0fa721adeabf1d93ad71e598782b52c43d8e8f7 (patch)
tree178af9fe18fbecf902606f25daccab6a0c2d666f /test/functional/core
parent7668f89d5be6d463bf6ab0c2d3a0393e3ec26e7f (diff)
downloadrneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.tar.gz
rneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.tar.bz2
rneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.zip
fix(startup): make recovery mode work without --headless (#24477)
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/remote_spec.lua5
-rw-r--r--test/functional/core/startup_spec.lua13
2 files changed, 15 insertions, 3 deletions
diff --git a/test/functional/core/remote_spec.lua b/test/functional/core/remote_spec.lua
index 39b1ee2f5f..a0ec748446 100644
--- a/test/functional/core/remote_spec.lua
+++ b/test/functional/core/remote_spec.lua
@@ -43,7 +43,6 @@ describe('Remote', function()
local function run_remote(...)
set_session(server)
local addr = funcs.serverlist()[1]
- local client_argv = { nvim_prog, '--clean', '--headless', '--server', addr, ... }
-- Create an nvim instance just to run the remote-invoking nvim. We want
-- to wait for the remote instance to exit and calling jobwait blocks
@@ -52,7 +51,7 @@ describe('Remote', function()
local client_starter = spawn(new_argv(), false, nil, true)
set_session(client_starter)
-- Call jobstart() and jobwait() in the same RPC request to reduce flakiness.
- eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart(..., {
+ eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart({...}, {
stdout_buffered = true,
stderr_buffered = true,
on_stdout = function(_, data, _)
@@ -61,7 +60,7 @@ describe('Remote', function()
on_stderr = function(_, data, _)
_G.Remote_stderr = table.concat(data, '\n')
end,
- }) })]], client_argv))
+ }) })]], nvim_prog, '--clean', '--headless', '--server', addr, ...))
local res = exec_lua([[return { _G.Remote_stdout, _G.Remote_stderr }]])
client_starter:close()
set_session(server)
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index dcbb55a9d7..c1e07f0c76 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -21,6 +21,7 @@ local nvim_set = helpers.nvim_set
local read_file = helpers.read_file
local retry = helpers.retry
local rmdir = helpers.rmdir
+local skip = helpers.skip
local sleep = helpers.sleep
local startswith = helpers.startswith
local write_file = helpers.write_file
@@ -460,6 +461,18 @@ describe('startup', function()
]])
end)
+ it('-r works without --headless in PTY #23294', function()
+ skip(is_os('win'))
+ eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart({...}, {
+ pty = true,
+ stdout_buffered = true,
+ on_stdout = function(_, data, _)
+ _G.Recovery_stdout = data
+ end,
+ }) })]], nvim_prog, '-u', 'NONE', '-i', 'NONE', '-r'))
+ matches('Swap files found:\r*', exec_lua('return _G.Recovery_stdout[1]'))
+ end)
+
it('fixed hang issue with --headless (#11386)', function()
local expected = ''
local period = 100