diff options
Diffstat (limited to 'test/functional/autocmd')
-rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/autocmd/tabclose_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/autocmd/tabnew_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/autocmd/tabnewentered_spec.lua | 43 | ||||
-rw-r--r-- | test/functional/autocmd/termclose_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/autocmd/textyankpost_spec.lua | 2 |
6 files changed, 31 insertions, 22 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index 3c813abc2e..72aff58d73 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -1,4 +1,4 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local command = helpers.command diff --git a/test/functional/autocmd/tabclose_spec.lua b/test/functional/autocmd/tabclose_spec.lua index bf609d1846..65182ad859 100644 --- a/test/functional/autocmd/tabclose_spec.lua +++ b/test/functional/autocmd/tabclose_spec.lua @@ -1,4 +1,4 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq describe('TabClosed', function() diff --git a/test/functional/autocmd/tabnew_spec.lua b/test/functional/autocmd/tabnew_spec.lua index aaf9db0a99..8c94dee49b 100644 --- a/test/functional/autocmd/tabnew_spec.lua +++ b/test/functional/autocmd/tabnew_spec.lua @@ -1,4 +1,4 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local command = helpers.command diff --git a/test/functional/autocmd/tabnewentered_spec.lua b/test/functional/autocmd/tabnewentered_spec.lua index 64b9a22f41..7044307399 100644 --- a/test/functional/autocmd/tabnewentered_spec.lua +++ b/test/functional/autocmd/tabnewentered_spec.lua @@ -1,22 +1,31 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq describe('TabNewEntered', function() - describe('au TabNewEntered', function() - describe('with * as <afile>', function() - it('matches when entering any new tab', function() - clear() - nvim('command', 'au! TabNewEntered * echom "tabnewentered:".tabpagenr().":".bufnr("")') - eq("\ntabnewentered:2:2", nvim('command_output', 'tabnew')) - eq("\n\"test.x2\" [New File]\ntabnewentered:3:3", nvim('command_output', 'tabnew test.x2')) - end) - end) - describe('with FILE as <afile>', function() - it('matches when opening a new tab for FILE', function() - local tmp_path = nvim('eval', 'tempname()') - nvim('command', 'au! TabNewEntered '..tmp_path..' echom "tabnewentered:match"') - eq("\n\""..tmp_path.."\" [New File]\ntabnewentered:4:4\ntabnewentered:match", nvim('command_output', 'tabnew '..tmp_path)) - end) - end) + describe('au TabNewEntered', function() + describe('with * as <afile>', function() + it('matches when entering any new tab', function() + clear() + nvim('command', 'au! TabNewEntered * echom "tabnewentered:".tabpagenr().":".bufnr("")') + eq("\ntabnewentered:2:2", nvim('command_output', 'tabnew')) + eq("\n\"test.x2\" [New File]\ntabnewentered:3:3", nvim('command_output', 'tabnew test.x2')) + end) end) + describe('with FILE as <afile>', function() + it('matches when opening a new tab for FILE', function() + local tmp_path = nvim('eval', 'tempname()') + nvim('command', 'au! TabNewEntered '..tmp_path..' echom "tabnewentered:match"') + eq("\n\""..tmp_path.."\" [New File]\ntabnewentered:4:4\ntabnewentered:match", nvim('command_output', 'tabnew '..tmp_path)) + end) + end) + describe('with CTRL-W T', function() + it('works when opening a new tab with CTRL-W T', function() + clear() + nvim('command', 'au! TabNewEntered * echom "entered"') + nvim('command', 'tabnew test.x2') + nvim('command', 'split') + eq('\nentered', nvim('command_output', 'execute "normal \\<C-W>T"')) + end) + end) + end) end) diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua index 4de3f039c1..02ea0dbd95 100644 --- a/test/functional/autocmd/termclose_spec.lua +++ b/test/functional/autocmd/termclose_spec.lua @@ -1,4 +1,4 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, execute, feed, nvim, nvim_dir = helpers.clear, diff --git a/test/functional/autocmd/textyankpost_spec.lua b/test/functional/autocmd/textyankpost_spec.lua index c26ceeaedc..bd5f1912c5 100644 --- a/test/functional/autocmd/textyankpost_spec.lua +++ b/test/functional/autocmd/textyankpost_spec.lua @@ -1,4 +1,4 @@ -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq local feed, execute, expect, command = helpers.feed, helpers.execute, helpers.expect, helpers.command local curbufmeths, funcs, neq = helpers.curbufmeths, helpers.funcs, helpers.neq |