aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-22 15:39:38 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-04 10:00:17 -0400
commitefa132da827f7df03ba9041e0db5b824fbacde6c (patch)
treee47fae1b67c4e0a61103bc88d6c6926fe8056059 /src
parentc87510b0e803f44ca06b16f831d6fa5c196da1de (diff)
downloadrneovim-efa132da827f7df03ba9041e0db5b824fbacde6c.tar.gz
rneovim-efa132da827f7df03ba9041e0db5b824fbacde6c.tar.bz2
rneovim-efa132da827f7df03ba9041e0db5b824fbacde6c.zip
vim-patch:8.0.1048: no test for what 8.0.1020 fixes
Problem: No test for what 8.0.1020 fixes. Solution: Add test_feedinput(). Add a test. (Ozaki Kiichi, closes vim/vim#2046) https://github.com/vim/vim/commit/5e80de3f3e572805fe734b66bc42c13303ad9bdb
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_timers.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index 81ac2b6171..6450bf02e8 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -169,5 +169,25 @@ func Test_stop_all_in_callback()
call assert_equal(0, len(info))
endfunc
+func FeedAndPeek(timer)
+ call test_feedinput('a')
+ call getchar(1)
+endfunc
+
+func Interrupt(timer)
+ call test_feedinput("\<C-C>")
+endfunc
+
+func Test_peek_and_get_char()
+ throw 'skipped: Nvim does not support test_feedinput()'
+ if !has('unix') && !has('gui_running')
+ return
+ endif
+ call timer_start(0, 'FeedAndPeek')
+ let intr = timer_start(100, 'Interrupt')
+ let c = getchar()
+ call assert_equal(char2nr('a'), c)
+ call timer_stop(intr)
+endfunc
" vim: shiftwidth=2 sts=2 expandtab