tests: add functional test for BufModifiedSet

This commit is contained in:
Rom Grk 2020-11-07 19:18:00 -05:00
parent 56f842e873
commit 3628d1ef72

View File

@ -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)