aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/ex_terminal_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-26 09:47:49 +0800
committerGitHub <noreply@github.com>2024-02-26 09:47:49 +0800
commit268066e01400f55b0c38716f0d6ee3dece10c43e (patch)
tree42443f64d3d89dadde0c9808d5ba8b22c256db29 /test/functional/terminal/ex_terminal_spec.lua
parent185752614d1a4906c8f218e4c24c3b52bbe6560e (diff)
downloadrneovim-268066e01400f55b0c38716f0d6ee3dece10c43e.tar.gz
rneovim-268066e01400f55b0c38716f0d6ee3dece10c43e.tar.bz2
rneovim-268066e01400f55b0c38716f0d6ee3dece10c43e.zip
fix(process): start pty process eof timer on main thread (#27625)
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua30
1 files changed, 19 insertions, 11 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 0a1ba6d980..92d37fc04a 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -170,20 +170,18 @@ local function test_terminal_with_fake_shell(backslash)
screen:attach({ rgb = false })
api.nvim_set_option_value('shell', shell_path, {})
api.nvim_set_option_value('shellcmdflag', 'EXE', {})
- api.nvim_set_option_value('shellxquote', '', {})
+ api.nvim_set_option_value('shellxquote', '', {}) -- win: avoid extra quotes
end)
it('with no argument, acts like termopen()', function()
command('autocmd! nvim_terminal TermClose')
feed_command('terminal')
- retry(nil, 4 * screen.timeout, function()
- screen:expect([[
+ screen:expect([[
^ready $ |
[Process exited 0] |
|
:terminal |
]])
- end)
end)
it("with no argument, and 'shell' is set to empty string", function()
@@ -207,7 +205,6 @@ local function test_terminal_with_fake_shell(backslash)
end)
it('executes a given command through the shell', function()
- command('set shellxquote=') -- win: avoid extra quotes
feed_command('terminal echo hi')
screen:expect([[
^ready $ echo hi |
@@ -219,7 +216,6 @@ local function test_terminal_with_fake_shell(backslash)
it("executes a given command through the shell, when 'shell' has arguments", function()
api.nvim_set_option_value('shell', shell_path .. ' -t jeff', {})
- command('set shellxquote=') -- win: avoid extra quotes
feed_command('terminal echo hi')
screen:expect([[
^jeff $ echo hi |
@@ -230,7 +226,6 @@ local function test_terminal_with_fake_shell(backslash)
end)
it('allows quotes and slashes', function()
- command('set shellxquote=') -- win: avoid extra quotes
feed_command([[terminal echo 'hello' \ "world"]])
screen:expect([[
^ready $ echo 'hello' \ "world" |
@@ -287,16 +282,13 @@ local function test_terminal_with_fake_shell(backslash)
end)
it('works with gf', function()
- command('set shellxquote=') -- win: avoid extra quotes
feed_command([[terminal echo "scripts/shadacat.py"]])
- retry(nil, 4 * screen.timeout, function()
- screen:expect([[
+ screen:expect([[
^ready $ echo "scripts/shadacat.py" |
|
[Process exited 0] |
:terminal echo "scripts/shadacat.py" |
]])
- end)
feed([[<C-\><C-N>]])
eq('term://', string.match(eval('bufname("%")'), '^term://'))
feed([[ggf"lgf]])
@@ -313,6 +305,22 @@ local function test_terminal_with_fake_shell(backslash)
terminal]])
end
end)
+
+ describe('exit does not have long delay #27615', function()
+ for _, ut in ipairs({ 5, 50, 500, 5000, 50000, 500000 }) do
+ it(('with updatetime=%d'):format(ut), function()
+ api.nvim_set_option_value('updatetime', ut, {})
+ api.nvim_set_option_value('shellcmdflag', 'EXIT', {})
+ feed_command('terminal 42')
+ screen:expect([[
+ ^ |
+ [Process exited 42] |
+ |
+ :terminal 42 |
+ ]])
+ end)
+ end
+ end)
end
describe(':terminal (with fake shell)', function()