diff options
author | Rom Grk <romgrk.cc@gmail.com> | 2020-11-07 19:18:00 -0500 |
---|---|---|
committer | Rom Grk <romgrk.cc@gmail.com> | 2020-11-07 19:18:00 -0500 |
commit | 3628d1ef72cd48cef49db5ace9bfe77eb77d18f8 (patch) | |
tree | 5ee500a39bea8722d77d54f365bc48245220c528 | |
parent | 56f842e87378bb8de99b98e3aacd7714cfeed1ef (diff) | |
download | rneovim-3628d1ef72cd48cef49db5ace9bfe77eb77d18f8.tar.gz rneovim-3628d1ef72cd48cef49db5ace9bfe77eb77d18f8.tar.bz2 rneovim-3628d1ef72cd48cef49db5ace9bfe77eb77d18f8.zip |
tests: add functional test for BufModifiedSet
-rw-r--r-- | test/functional/autocmd/bufmodifiedset_spec.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/autocmd/bufmodifiedset_spec.lua b/test/functional/autocmd/bufmodifiedset_spec.lua new file mode 100644 index 0000000000..25f4442d14 --- /dev/null +++ b/test/functional/autocmd/bufmodifiedset_spec.lua @@ -0,0 +1,20 @@ +local helpers = require('test.functional.helpers')(after_each) + +local clear = helpers.clear +local eq = helpers.eq +local eval = helpers.eval +local source = helpers.source + +describe('BufModified', function() + before_each(clear) + + it('is triggered when modified and un-modified', function() + source([[ + let g:modified = 0 + autocmd BufModifiedSet * let g:modified += 1 + execute "normal! aa\<Esc>" + execute "normal! u" + ]]) + eq(2, eval('g:modified')) + end) +end) |