summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/autocmd/filetype_spec.lua
blob: da2d2050fbad5d09a8213d1467d2bdbd598cb3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local n = require('test.functional.testnvim')()

local eval = n.eval
local clear = n.clear
local command = n.command

describe('autocmd FileType', function()
  before_each(clear)

  it('is triggered by :help only once', function()
    n.add_builddir_to_rtp()
    command('let g:foo = 0')
    command('autocmd FileType help let g:foo = g:foo + 1')
    command('help help')
    assert.eq(1, eval('g:foo'))
  end)
end)