diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-08-08 17:51:57 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2016-08-10 11:22:28 +0200 |
commit | 0a51d26b33d3d540a380563049bbd8fe610bd12f (patch) | |
tree | 55107929dd62fcfdb163284170a37034f8b33157 /test/functional/eval/timer_spec.lua | |
parent | db375102ead998421a180525299f66db3e6127f3 (diff) | |
download | rneovim-0a51d26b33d3d540a380563049bbd8fe610bd12f.tar.gz rneovim-0a51d26b33d3d540a380563049bbd8fe610bd12f.tar.bz2 rneovim-0a51d26b33d3d540a380563049bbd8fe610bd12f.zip |
timers: do not crash after processing events in the handler
Diffstat (limited to 'test/functional/eval/timer_spec.lua')
-rw-r--r-- | test/functional/eval/timer_spec.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 2f83edb9e4..80c16e6ee3 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -119,6 +119,21 @@ describe('timers', function() eq(2,eval("g:val2")) end) + it('do not crash when processing events in the handler', function() + source([[ + let g:val = 0 + func! MyHandler(timer) + call timer_stop(a:timer) + sleep 100m + let g:val += 1 + endfunc + ]]) + execute("call timer_start(5, 'MyHandler', {'repeat': 1})") + run(nil, nil, nil, 300) + eq(1,eval("g:val")) + end) + + it("doesn't mess up the cmdline", function() local screen = Screen.new(40, 6) screen:attach() |