aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-09-09 17:45:00 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-09-09 21:26:55 +0200
commitb927e50c53d4db8841ce917b76226f571463d5a1 (patch)
treec86dded6dfd77a94620f3328ec34e8ad6c40a1f7
parent7c00b10d8d99e9794e5e744c813164c45fc3c8b6 (diff)
downloadrneovim-b927e50c53d4db8841ce917b76226f571463d5a1.tar.gz
rneovim-b927e50c53d4db8841ce917b76226f571463d5a1.tar.bz2
rneovim-b927e50c53d4db8841ce917b76226f571463d5a1.zip
test: FocusGained: retry() cmdline-mode test
-rw-r--r--test/functional/terminal/tui_spec.lua40
1 files changed, 21 insertions, 19 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 09b28589ac..d36eb46e54 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -293,25 +293,27 @@ describe('tui FocusGained/FocusLost', function()
feed_data(":autocmd!\n")
feed_data(":autocmd FocusLost * call append(line('$'), 'lost')\n")
feed_data(":autocmd FocusGained * call append(line('$'), 'gained')\n")
- -- Enter cmdline-mode.
- feed_data(':')
- screen:sleep(1)
- -- Send focus lost/gained termcodes.
- feed_data('\027[O')
- feed_data('\027[I')
- screen:sleep(1)
- -- Exit cmdline-mode. Redraws from timers/events are blocked during
- -- cmdline-mode, so the buffer won't be updated until we exit cmdline-mode.
- feed_data('\n')
- screen:expect([[
- {1: } |
- lost |
- gained |
- {4:~ }|
- {5:[No Name] [+] }|
- : |
- {3:-- TERMINAL --} |
- ]])
+ retry(2, 3 * screen.timeout, function()
+ -- Enter cmdline-mode.
+ feed_data(':')
+ screen:sleep(1)
+ -- Send focus lost/gained termcodes.
+ feed_data('\027[O')
+ feed_data('\027[I')
+ screen:sleep(1)
+ -- Exit cmdline-mode. Redraws from timers/events are blocked during
+ -- cmdline-mode, so the buffer won't be updated until we exit cmdline-mode.
+ feed_data('\n')
+ screen:expect([[
+ {1: } |
+ lost |
+ gained |
+ {4:~ }|
+ {5:[No Name] [+] }|
+ : |
+ {3:-- TERMINAL --} |
+ ]])
+ end)
end)
it('in terminal-mode', function()