diff src/testdir/test_timers.vim @ 15665:31367ce5aac7 v8.1.0840

patch 8.1.0840: getchar(0) never returns a character in the terminal commit https://github.com/vim/vim/commit/12dfc9eef14fe74c46145aa9e6cba9666f1bcd40 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 28 22:32:58 2019 +0100 patch 8.1.0840: getchar(0) never returns a character in the terminal Problem: getchar(0) never returns a character in the terminal. Solution: Call wait_func() at least once.
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Jan 2019 22:45:05 +0100
parents eadecbe4e390
children d2ec272ae777
line wrap: on
line diff
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -250,6 +250,16 @@ func Test_peek_and_get_char()
   call timer_stop(intr)
 endfunc
 
+func Test_getchar_zero()
+  call timer_start(20, {id -> feedkeys('x', 'L')})
+  let c = 0
+  while c == 0
+    let c = getchar(0)
+    sleep 10m
+  endwhile
+  call assert_equal('x', nr2char(c))
+endfunc
+
 func Test_ex_mode()
   " Function with an empty line.
   func Foo(...)