diff options
author | Rom Grk <romgrk.cc@gmail.com> | 2020-10-24 05:48:00 -0400 |
---|---|---|
committer | Rom Grk <romgrk.cc@gmail.com> | 2020-10-24 05:48:00 -0400 |
commit | bcf79c62bca76b8b2fb5f51e3f83d4c645d91684 (patch) | |
tree | ffcdaf0e3630f669b2441a818d3be9dca33cd7be | |
parent | ffe1a067df5b28726cc1ab7b440108c84a6e8624 (diff) | |
download | rneovim-bcf79c62bca76b8b2fb5f51e3f83d4c645d91684.tar.gz rneovim-bcf79c62bca76b8b2fb5f51e3f83d4c645d91684.tar.bz2 rneovim-bcf79c62bca76b8b2fb5f51e3f83d4c645d91684.zip |
tests: add test for Scroll autocmd
-rw-r--r-- | test/functional/autocmd/scroll_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/autocmd/scroll_spec.lua b/test/functional/autocmd/scroll_spec.lua new file mode 100644 index 0000000000..f76d80812c --- /dev/null +++ b/test/functional/autocmd/scroll_spec.lua @@ -0,0 +1,24 @@ +local helpers = require('test.functional.helpers')(after_each) + +local clear = helpers.clear +local eq = helpers.eq +local eval = helpers.eval +local funcs = helpers.funcs +local source = helpers.source + +describe('Scroll', function() + before_each(clear) + + it('is triggered by scrolling the window', function() + source([[ + let g:scroll = 0 + let g:buf = bufnr('%') + + autocmd scroll * let g:scroll += 1 + + call nvim_buf_set_lines(g:buf, 0, -1, v:true, ['1', '2', '3', '4', '5']) + call feedkeys("\<C-e>", "n") + ]]) + eq(1, eval('g:scroll')) + end) +end) |