summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_arglist.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-07 20:46:39 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-07 20:46:39 +0200
commit53f1673cd909eb1c809c6a9086e3d104a0df9bed (patch)
tree99ba38cb528eafc2b79ffc13e743da43ea7e9f8e /src/testdir/test_arglist.vim
parent1b0c1d050e28f351650c0c84e234fd24f12e5e29 (diff)
patch 7.4.2343v7.4.2343
Problem: Too many old file tests. Solution: Turn several into new style tests. (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir/test_arglist.vim')
-rw-r--r--src/testdir/test_arglist.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim
index 4244344270..0caead8482 100644
--- a/src/testdir/test_arglist.vim
+++ b/src/testdir/test_arglist.vim
@@ -287,3 +287,32 @@ function Test_argpos()
call assert_equal(0, argidx())
%argd
endfunction
+
+" Test for autocommand that redefines the argument list, when doing ":all".
+function Test_arglist_autocmd()
+ autocmd BufReadPost Xxx2 next Xxx2 Xxx1
+ call writefile(['test file Xxx1'], 'Xxx1')
+ call writefile(['test file Xxx2'], 'Xxx2')
+ call writefile(['test file Xxx3'], 'Xxx3')
+
+ new
+ " redefine arglist; go to Xxx1
+ next! Xxx1 Xxx2 Xxx3
+ " open window for all args
+ all
+ call assert_equal('test file Xxx1', getline(1))
+ wincmd w
+ wincmd w
+ call assert_equal('test file Xxx1', getline(1))
+ " should now be in Xxx2
+ rewind
+ call assert_equal('test file Xxx2', getline(1))
+
+ autocmd! BufReadPost Xxx2
+ enew! | only
+ call delete('Xxx1')
+ call delete('Xxx2')
+ call delete('Xxx3')
+ argdelete Xxx*
+ bwipe! Xxx1 Xxx2 Xxx3
+endfunction