Mercurial > vim
comparison src/testdir/test_timers.vim @ 17657:0da9bc55c31a v8.1.1826
patch 8.1.1826: tests use hand coded feature and option checks
commit https://github.com/vim/vim/commit/8c5a278fc508da6dfe50e69b6ee734451aa4eafb
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 7 23:07:07 2019 +0200
patch 8.1.1826: tests use hand coded feature and option checks
Problem: Tests use hand coded feature and option checks.
Solution: Use the commands from check.vim in more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 07 Aug 2019 23:15:07 +0200 |
parents | 3e2e998ce0db |
children | 7d56da1c98f0 |
comparison
equal
deleted
inserted
replaced
17656:2adce9da20d8 | 17657:0da9bc55c31a |
---|---|
237 func Interrupt(timer) | 237 func Interrupt(timer) |
238 call test_feedinput("\<C-C>") | 238 call test_feedinput("\<C-C>") |
239 endfunc | 239 endfunc |
240 | 240 |
241 func Test_peek_and_get_char() | 241 func Test_peek_and_get_char() |
242 if !has('unix') && !has('gui_running') | 242 CheckUnix |
243 return | 243 CheckGui |
244 endif | 244 |
245 call timer_start(0, 'FeedAndPeek') | 245 call timer_start(0, 'FeedAndPeek') |
246 let intr = timer_start(100, 'Interrupt') | 246 let intr = timer_start(100, 'Interrupt') |
247 let c = getchar() | 247 let c = getchar() |
248 call assert_equal(char2nr('a'), c) | 248 call assert_equal(char2nr('a'), c) |
249 call timer_stop(intr) | 249 call timer_stop(intr) |
250 endfunc | 250 endfunc |
251 | 251 |
252 func Test_getchar_zero() | 252 func Test_getchar_zero() |
253 if has('win32') && !has('gui_running') | 253 if has('win32') && !has('gui_running') |
254 " Console: no low-level input | 254 throw 'Skipped: cannot get low-level input' |
255 return | |
256 endif | 255 endif |
257 | 256 |
258 " Measure the elapsed time to avoid a hang when it fails. | 257 " Measure the elapsed time to avoid a hang when it fails. |
259 let start = reltime() | 258 let start = reltime() |
260 let id = timer_start(20, {-> feedkeys('x', 'L')}) | 259 let id = timer_start(20, {-> feedkeys('x', 'L')}) |