Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 18635:dfa87465287e v8.1.2310
patch 8.1.2310: no proper test for directory changes in quickfix
Commit: https://github.com/vim/vim/commit/d8a8c4ca089eaaf7934c0f2b3be676df5a4c0248
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 16 21:04:57 2019 +0100
patch 8.1.2310: no proper test for directory changes in quickfix
Problem: No proper test for directory changes in quickfix.
Solution: Add a test that uses multiple directories. (Yegappan Lakshmanan,
closes #5230)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 16 Nov 2019 21:15:03 +0100 |
parents | 0ac9e720a56e |
children | 394abd397e15 |
comparison
equal
deleted
inserted
replaced
18634:ab07a621318f | 18635:dfa87465287e |
---|---|
4391 augroup QF_Test | 4391 augroup QF_Test |
4392 au! | 4392 au! |
4393 augroup END | 4393 augroup END |
4394 endfunc | 4394 endfunc |
4395 | 4395 |
4396 " Test for using a file in one of the parent directories. | |
4397 func Test_search_in_dirstack() | |
4398 call mkdir('Xtestdir/a/b/c', 'p') | |
4399 let save_cwd = getcwd() | |
4400 call writefile(["X1_L1", "X1_L2"], 'Xtestdir/Xfile1') | |
4401 call writefile(["X2_L1", "X2_L2"], 'Xtestdir/a/Xfile2') | |
4402 call writefile(["X3_L1", "X3_L2"], 'Xtestdir/a/b/Xfile3') | |
4403 call writefile(["X4_L1", "X4_L2"], 'Xtestdir/a/b/c/Xfile4') | |
4404 | |
4405 let lines = "Entering dir Xtestdir\n" . | |
4406 \ "Entering dir a\n" . | |
4407 \ "Entering dir b\n" . | |
4408 \ "Xfile2:2:X2_L2\n" . | |
4409 \ "Leaving dir a\n" . | |
4410 \ "Xfile1:2:X1_L2\n" . | |
4411 \ "Xfile3:1:X3_L1\n" . | |
4412 \ "Entering dir c\n" . | |
4413 \ "Xfile4:2:X4_L2\n" . | |
4414 \ "Leaving dir c\n" . | |
4415 \ "Leaving dir Xtestdir\n" | |
4416 set efm=%DEntering\ dir\ %f,%XLeaving\ dir\ %f,%f:%l:%m | |
4417 cexpr lines | |
4418 call assert_equal(11, getqflist({'size' : 0}).size) | |
4419 call assert_equal(4, getqflist({'idx' : 0}).idx) | |
4420 call assert_equal('X2_L2', getline('.')) | |
4421 cnext | |
4422 call assert_equal(6, getqflist({'idx' : 0}).idx) | |
4423 call assert_equal('X1_L2', getline('.')) | |
4424 cnext | |
4425 call assert_equal(7, getqflist({'idx' : 0}).idx) | |
4426 call assert_equal(1, line('$')) | |
4427 call assert_equal('', getline(1)) | |
4428 cnext | |
4429 call assert_equal(9, getqflist({'idx' : 0}).idx) | |
4430 call assert_equal(1, line('$')) | |
4431 call assert_equal('', getline(1)) | |
4432 | |
4433 set efm& | |
4434 exe 'cd ' . save_cwd | |
4435 call delete('Xtestdir', 'rf') | |
4436 endfunc | |
4437 | |
4396 " vim: shiftwidth=2 sts=2 expandtab | 4438 " vim: shiftwidth=2 sts=2 expandtab |