aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-10-17 22:04:53 +0800
committerzeertzjq <zeertzjq@outlook.com>2021-10-17 22:04:53 +0800
commit38821cc50e7d353b7e8a372da8413e550595b734 (patch)
treec7258cb50d06217262df0c8336de5d22ba5d7afa
parent6004f9137a5625025cfa76700239d9abcac85f47 (diff)
downloadrneovim-38821cc50e7d353b7e8a372da8413e550595b734.tar.gz
rneovim-38821cc50e7d353b7e8a372da8413e550595b734.tar.bz2
rneovim-38821cc50e7d353b7e8a372da8413e550595b734.zip
test(dirchanged): add tests for DirChanged pattern "auto"
-rw-r--r--test/functional/autocmd/dirchanged_spec.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/autocmd/dirchanged_spec.lua b/test/functional/autocmd/dirchanged_spec.lua
index bbbc98e5a2..f4a1642ebf 100644
--- a/test/functional/autocmd/dirchanged_spec.lua
+++ b/test/functional/autocmd/dirchanged_spec.lua
@@ -104,16 +104,19 @@ describe('autocmd DirChanged', function()
command('split '..dirs[1]..'/foo')
eq({cwd=dirs[1], scope='window', changed_window=false}, eval('g:ev'))
+ eq('auto', eval('g:amatch'))
command('split '..dirs[2]..'/bar')
eq({cwd=dirs[2], scope='window', changed_window=false}, eval('g:ev'))
+ eq('auto', eval('g:amatch'))
eq(2, eval('g:cdcount'))
end)
- it('does not trigger if diretory has not changed', function()
+ it('does not trigger if directory has not changed', function()
command('lcd '..dirs[1])
eq({cwd=dirs[1], scope='window', changed_window=false}, eval('g:ev'))
+ eq('window', eval('g:amatch'))
eq(1, eval('g:cdcount'))
command('let g:ev = {}')
command('lcd '..dirs[1])
@@ -143,6 +146,7 @@ describe('autocmd DirChanged', function()
command('cd '..dirs[3])
eq({cwd=dirs[3], scope='global', changed_window=false}, eval('g:ev'))
+ eq('global', eval('g:amatch'))
eq(3, eval('g:cdcount'))
command('let g:ev = {}')
command('cd '..dirs[3])
@@ -159,6 +163,7 @@ describe('autocmd DirChanged', function()
command('split '..dirs[1]..'/foo')
eq({cwd=dirs[1], scope='window', changed_window=false}, eval('g:ev'))
+ eq('auto', eval('g:amatch'))
eq(4, eval('g:cdcount'))
command('let g:ev = {}')
command('split '..dirs[1]..'/bar')
@@ -181,6 +186,7 @@ describe('autocmd DirChanged', function()
command('2wincmd w') -- window 2
eq({cwd=dirs[2], scope='window', changed_window=true}, eval('g:ev'))
+ eq('window', eval('g:amatch'))
eq(4, eval('g:cdcount'))
command('tabnew') -- tab 2 (tab-local CWD)