Mercurial > vim
diff src/testdir/test_arglist.vim @ 10145:eb9a7296ae9f v7.4.2343
commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 7 20:46:39 2016 +0200
patch 7.4.2343
Problem: Too many old file tests.
Solution: Turn several into new style tests. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 07 Sep 2016 21:00:08 +0200 |
parents | f6311c321411 |
children | 3335c3c75611 |
line wrap: on
line diff
--- 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