Mercurial > vim
comparison src/testdir/test_timers.vim @ 12337:040a892d0eed v8.0.1048
patch 8.0.1048: no test for what 8.0.1020 fixes
commit https://github.com/vim/vim/commit/5e80de3f3e572805fe734b66bc42c13303ad9bdb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 3 15:48:12 2017 +0200
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 https://github.com/vim/vim/issues/2046)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 03 Sep 2017 16:00:05 +0200 |
parents | 71d7b5ed08a0 |
children | 61a9642297cc |
comparison
equal
deleted
inserted
replaced
12336:3914c0edd581 | 12337:040a892d0eed |
---|---|
204 call WaitFor('g:call_count == 3') | 204 call WaitFor('g:call_count == 3') |
205 sleep 50m | 205 sleep 50m |
206 call assert_equal(3, g:call_count) | 206 call assert_equal(3, g:call_count) |
207 endfunc | 207 endfunc |
208 | 208 |
209 func FeedAndPeek(timer) | |
210 call test_feedinput('a') | |
211 call getchar(1) | |
212 endfunc | |
213 | |
214 func Interrupt(timer) | |
215 call test_feedinput("\<C-C>") | |
216 endfunc | |
217 | |
218 func Test_peek_and_get_char() | |
219 if !has('unix') && !has('gui_running') | |
220 return | |
221 endif | |
222 call timer_start(0, 'FeedAndPeek') | |
223 let intr = timer_start(100, 'Interrupt') | |
224 let c = getchar() | |
225 call assert_equal(char2nr('a'), c) | |
226 call timer_stop(intr) | |
227 endfunc | |
209 | 228 |
210 " vim: shiftwidth=2 sts=2 expandtab | 229 " vim: shiftwidth=2 sts=2 expandtab |