From efa132da827f7df03ba9041e0db5b824fbacde6c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 22 Aug 2018 15:39:38 -0400 Subject: 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 --- src/nvim/testdir/test_timers.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') 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("\") +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 -- cgit