comparison 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
comparison
equal deleted inserted replaced
10144:edc80d8a7d2f 10145:eb9a7296ae9f
285 call assert_equal(3, argidx()) 285 call assert_equal(3, argidx())
286 rewind 286 rewind
287 call assert_equal(0, argidx()) 287 call assert_equal(0, argidx())
288 %argd 288 %argd
289 endfunction 289 endfunction
290
291 " Test for autocommand that redefines the argument list, when doing ":all".
292 function Test_arglist_autocmd()
293 autocmd BufReadPost Xxx2 next Xxx2 Xxx1
294 call writefile(['test file Xxx1'], 'Xxx1')
295 call writefile(['test file Xxx2'], 'Xxx2')
296 call writefile(['test file Xxx3'], 'Xxx3')
297
298 new
299 " redefine arglist; go to Xxx1
300 next! Xxx1 Xxx2 Xxx3
301 " open window for all args
302 all
303 call assert_equal('test file Xxx1', getline(1))
304 wincmd w
305 wincmd w
306 call assert_equal('test file Xxx1', getline(1))
307 " should now be in Xxx2
308 rewind
309 call assert_equal('test file Xxx2', getline(1))
310
311 autocmd! BufReadPost Xxx2
312 enew! | only
313 call delete('Xxx1')
314 call delete('Xxx2')
315 call delete('Xxx3')
316 argdelete Xxx*
317 bwipe! Xxx1 Xxx2 Xxx3
318 endfunction