summaryrefslogtreecommitdiff
path: root/src/testdir/test_timers.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_timers.vim')
-rw-r--r--src/testdir/test_timers.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim
index d30325b7b..0c6bb8338 100644
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -206,5 +206,24 @@ func Test_timer_errors()
call assert_equal(3, g:call_count)
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()
+ 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