From 3ad6fb804f0f382fac8f9810c3862b2c500e9c24 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 5 Oct 2020 23:57:37 -0400 Subject: vim-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 vim/vim#5230) https://github.com/vim/vim/commit/d8a8c4ca089eaaf7934c0f2b3be676df5a4c0248 --- src/nvim/testdir/test_quickfix.vim | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index fab5cb320f..dcebbe690f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -4049,4 +4049,46 @@ func Test_qfcmd_abort() augroup END endfunc +" Test for using a file in one of the parent directories. +func Test_search_in_dirstack() + call mkdir('Xtestdir/a/b/c', 'p') + let save_cwd = getcwd() + call writefile(["X1_L1", "X1_L2"], 'Xtestdir/Xfile1') + call writefile(["X2_L1", "X2_L2"], 'Xtestdir/a/Xfile2') + call writefile(["X3_L1", "X3_L2"], 'Xtestdir/a/b/Xfile3') + call writefile(["X4_L1", "X4_L2"], 'Xtestdir/a/b/c/Xfile4') + + let lines = "Entering dir Xtestdir\n" . + \ "Entering dir a\n" . + \ "Entering dir b\n" . + \ "Xfile2:2:X2_L2\n" . + \ "Leaving dir a\n" . + \ "Xfile1:2:X1_L2\n" . + \ "Xfile3:1:X3_L1\n" . + \ "Entering dir c\n" . + \ "Xfile4:2:X4_L2\n" . + \ "Leaving dir c\n" . + \ "Leaving dir Xtestdir\n" + set efm=%DEntering\ dir\ %f,%XLeaving\ dir\ %f,%f:%l:%m + cexpr lines + call assert_equal(11, getqflist({'size' : 0}).size) + call assert_equal(4, getqflist({'idx' : 0}).idx) + call assert_equal('X2_L2', getline('.')) + cnext + call assert_equal(6, getqflist({'idx' : 0}).idx) + call assert_equal('X1_L2', getline('.')) + cnext + call assert_equal(7, getqflist({'idx' : 0}).idx) + call assert_equal(1, line('$')) + call assert_equal('', getline(1)) + cnext + call assert_equal(9, getqflist({'idx' : 0}).idx) + call assert_equal(1, line('$')) + call assert_equal('', getline(1)) + + set efm& + exe 'cd ' . save_cwd + call delete('Xtestdir', 'rf') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From 779b188db6ade50f87565a8805ee7eee6bf0a2a7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 6 Oct 2020 00:07:40 -0400 Subject: vim-patch:8.1.2401: :cexpr does not handle | in expression Problem: :cexpr does not handle | in expression. Solution: Remove EX_TRLBAR and set nextcmd pointer. https://github.com/vim/vim/commit/88a3e2b2ac33e3bb4b7cf9132eb75db051e8f4ed --- src/nvim/testdir/test_quickfix.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nvim/testdir/test_quickfix.vim') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index dcebbe690f..42ca0fe1d3 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -95,7 +95,7 @@ func XlistTests(cchar) " Populate the list and then try Xgetexpr ['non-error 1', 'Xtestfile1:1:3:Line1', \ 'non-error 2', 'Xtestfile2:2:2:Line2', - \ 'non-error 3', 'Xtestfile3:3:1:Line3'] + \ 'non-error| 3', 'Xtestfile3:3:1:Line3'] " List only valid entries let l = split(execute('Xlist', ''), "\n") @@ -107,7 +107,7 @@ func XlistTests(cchar) let l = split(execute('Xlist!', ''), "\n") call assert_equal([' 1: non-error 1', ' 2 Xtestfile1:1 col 3: Line1', \ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2', - \ ' 5: non-error 3', ' 6 Xtestfile3:3 col 1: Line3'], l) + \ ' 5: non-error| 3', ' 6 Xtestfile3:3 col 1: Line3'], l) " List a range of errors let l = split(execute('Xlist 3,6', ''), "\n") @@ -507,7 +507,7 @@ func Xtest_browse(cchar) Xexpr "" call assert_equal(0, g:Xgetlist({'idx' : 0}).idx) call assert_equal(0, g:Xgetlist({'size' : 0}).size) - Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo'] + Xaddexpr ['foo', 'bar', 'baz', 'quux', 'sh|moo'] call assert_equal(5, g:Xgetlist({'size' : 0}).size) Xlast call assert_equal(5, g:Xgetlist({'idx' : 0}).idx) @@ -4067,13 +4067,13 @@ func Test_search_in_dirstack() \ "Xfile3:1:X3_L1\n" . \ "Entering dir c\n" . \ "Xfile4:2:X4_L2\n" . - \ "Leaving dir c\n" . - \ "Leaving dir Xtestdir\n" + \ "Leaving dir c\n" set efm=%DEntering\ dir\ %f,%XLeaving\ dir\ %f,%f:%l:%m - cexpr lines + cexpr lines .. "Leaving dir Xtestdir|\n" | let next = 1 call assert_equal(11, getqflist({'size' : 0}).size) call assert_equal(4, getqflist({'idx' : 0}).idx) call assert_equal('X2_L2', getline('.')) + call assert_equal(1, next) cnext call assert_equal(6, getqflist({'idx' : 0}).idx) call assert_equal('X1_L2', getline('.')) -- cgit