mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tests: fix racyness in terminal/api_spec.lua
Previously, the nvim_input from the socket channels could be processed before the input from stdin in rare cases.
This commit is contained in:
parent
2d961403ba
commit
d1070787ca
@ -22,7 +22,7 @@ describe('api', function()
|
||||
-- Start the socket from the child nvim.
|
||||
child_session.feed_data(":echo serverstart('"..socket_name.."')\n")
|
||||
|
||||
-- Wait for socket creation by abusing expect().
|
||||
-- Wait for socket creation.
|
||||
screen:expect([[
|
||||
{1: } |
|
||||
{4:~ }|
|
||||
@ -37,6 +37,16 @@ describe('api', function()
|
||||
local socket_session2 = helpers.connect(socket_name)
|
||||
|
||||
child_session.feed_data("i[tui] insert-mode")
|
||||
-- Wait for stdin to be processed.
|
||||
screen:expect([[
|
||||
[tui] insert-mode{1: } |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{5:[No Name] [+] }|
|
||||
{3:-- INSERT --} |
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
|
||||
ok(socket_session1:request("nvim_ui_attach", 42, 6, {rgb=true}))
|
||||
ok(socket_session2:request("nvim_ui_attach", 25, 30, {rgb=true}))
|
||||
|
Loading…
Reference in New Issue
Block a user