aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_timers.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index c4d74222a4..3043103270 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -313,4 +313,30 @@ func Test_restore_count()
call delete('Xtrctext')
endfunc
+" Test that the garbage collector isn't triggered if a timer callback invokes
+" vgetc().
+func Test_nocatch_garbage_collect()
+ " skipped: Nvim does not support test_garbagecollect_soon(), test_override()
+ return
+ " 'uptimetime. must be bigger than the timer timeout
+ set ut=200
+ call test_garbagecollect_soon()
+ call test_override('no_wait_return', 0)
+ func CauseAnError(id)
+ " This will show an error and wait for Enter.
+ let a = {'foo', 'bar'}
+ endfunc
+ func FeedChar(id)
+ call feedkeys('x', 't')
+ endfunc
+ call timer_start(300, 'FeedChar')
+ call timer_start(100, 'CauseAnError')
+ let x = getchar()
+
+ set ut&
+ call test_override('no_wait_return', 1)
+ delfunc CauseAnError
+ delfunc FeedChar
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab