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') 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/ex_cmds.lua | 12 ++++++------ src/nvim/quickfix.c | 2 +- src/nvim/testdir/test_quickfix.vim | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index a01f92df27..d62b00fee1 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -337,7 +337,7 @@ return { }, { command='caddexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM), addr_type=ADDR_LINES, func='ex_cexpr', }, @@ -409,7 +409,7 @@ return { }, { command='cexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR, BANG), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, BANG), addr_type=ADDR_LINES, func='ex_cexpr', }, @@ -447,7 +447,7 @@ return { }, { command='cgetexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM), addr_type=ADDR_LINES, func='ex_cexpr', }, @@ -1299,7 +1299,7 @@ return { }, { command='laddexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM), addr_type=ADDR_LINES, func='ex_cexpr', }, @@ -1389,7 +1389,7 @@ return { }, { command='lexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR, BANG), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, BANG), addr_type=ADDR_LINES, func='ex_cexpr', }, @@ -1427,7 +1427,7 @@ return { }, { command='lgetexpr', - flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR), + flags=bit.bor(NEEDARG, WORD1, NOTRLCOM), addr_type=ADDR_LINES, func='ex_cexpr', }, diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 0c9902aaec..7d4f52af34 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -6377,7 +6377,7 @@ void ex_cexpr(exarg_T *eap) // Evaluate the expression. When the result is a string or a list we can // use it to fill the errorlist. typval_T tv; - if (eval0(eap->arg, &tv, NULL, true) != FAIL) { + if (eval0(eap->arg, &tv, &eap->nextcmd, true) != FAIL) { if ((tv.v_type == VAR_STRING && tv.vval.v_string != NULL) || tv.v_type == VAR_LIST) { incr_quickfix_busy(); 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 From dfd1c6c417847815fa6a7ed24b90f51e3000787a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 6 Oct 2020 00:35:33 -0400 Subject: vim-patch:8.1.1619: tests are not run with GUI on Travis Problem: Tests are not run with GUI on Travis. Solution: Add a testgui job. (Ozaki Kiichi, closes vim/vim#4609) https://github.com/vim/vim/commit/435f9f06cac02c1d2e5c52435d36e80f4ad2a8bd N/A patches for version.c: vim-patch:8.1.1771: options test fails on MS-Windows Problem: Options test fails on MS-Windows. Solution: Add correct and incorrect values for 'completeslash'. https://github.com/vim/vim/commit/d4404b4391a0cd3ab197e09bee7828c88882f6b2 vim-patch:8.1.2274: newlines in 'balloonexpr' result only work in the GUI Problem: Newlines in 'balloonexpr' result only work in the GUI. Solution: Also recognize newlines in the terminal. (closes vim/vim#5193) https://github.com/vim/vim/commit/d1c1c823892d0713065934256f48e7f4e6609f99 vim-patch:8.2.0554: the GUI doesn't set t_Co Problem: The GUI doesn't set t_Co. Solution: In the GUI set t_Co to 256 * 256 * 256. (closes vim/vim#5903) https://github.com/vim/vim/commit/acc770a10f65107131473ea2ab4ae5d429dfe172 vim-patch:8.2.1806: MS-Windows with Python: Vim freezes after import command Problem: MS-Windows with Python: Vim freezes after import command. Solution: Use either "NUL" or "CONIN$" when reopening stdin. (Yasuhiro Matsumoto, closes vim/vim#7083) https://github.com/vim/vim/commit/253b16a4abdad1df350b9ddd9a709520b063934c --- src/nvim/testdir/test_highlight.vim | 14 +++++++++++--- src/nvim/testdir/test_mapping.vim | 2 +- src/nvim/testdir/test_timers.vim | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim index 6aa187b17e..00e42733a7 100644 --- a/src/nvim/testdir/test_highlight.vim +++ b/src/nvim/testdir/test_highlight.vim @@ -596,9 +596,17 @@ endfunc " This test must come before the Test_cursorline test, as it appears this " defines the Normal highlighting group anyway. func Test_1_highlight_Normalgroup_exists() - " MS-Windows GUI sets the font - if !has('win32') || !has('gui_running') - let hlNormal = HighlightArgs('Normal') + let hlNormal = HighlightArgs('Normal') + if !has('gui_running') call assert_match('hi Normal\s*clear', hlNormal) + elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') + " expect is DEFAULT_FONT of gui_gtk_x11.c + call assert_match('hi Normal\s*font=Monospace 10', hlNormal) + elseif has('gui_motif') || has('gui_athena') + " expect is DEFAULT_FONT of gui_x11.c + call assert_match('hi Normal\s*font=7x13', hlNormal) + elseif has('win32') + " expect any font + call assert_match('hi Normal\s*font=.*', hlNormal) endif endfunc diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index dd0da5db64..1a6b64e858 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -392,7 +392,7 @@ func Test_motionforce_omap() endfunc func Test_error_in_map_expr() - if !has('terminal') || (has('win32') && has('gui_running')) + if !has('terminal') || has('gui_running') throw 'Skipped: cannot run Vim in a terminal window' endif diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index c3b03fe1a5..ddf0ec61b2 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -341,7 +341,7 @@ func Test_nocatch_garbage_collect() endfunc func Test_error_in_timer_callback() - if !has('terminal') || (has('win32') && has('gui_running')) + if !has('terminal') || has('gui_running') throw 'Skipped: cannot run Vim in a terminal window' endif -- cgit From 7454b11ec115da973da36c36a76a5bf81967a5ff Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 6 Oct 2020 00:53:55 -0400 Subject: vim-patch:8.1.1624: when testing in the GUI may try to run gvim in a terminal Problem: When testing in the GUI may try to run gvim in a terminal. Solution: Add the -v argument. (Yee Cheng Chin, closes vim/vim#4605) Don't skip tests that work now. https://github.com/vim/vim/commit/0d702028feb859e6bde9a0c943d398d86294beb7 --- src/nvim/testdir/shared.vim | 7 +++++++ src/nvim/testdir/test_mapping.vim | 4 ++-- src/nvim/testdir/test_timers.vim | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 0d32f4d875..9bc037a59f 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -294,6 +294,13 @@ func GetVimCommandClean() return cmd endfunc +" Get the command to run Vim, with --clean, and force to run in terminal so it +" won't start a new GUI. +func GetVimCommandCleanTerm() + " Add -v to have gvim run in the terminal (if possible) + return GetVimCommandClean() .. ' -v ' +endfunc + " Run Vim, using the "vimcmd" file and "-u NORC". " "before" is a list of Vim commands to be executed before loading plugins. " "after" is a list of Vim commands to be executed after loading plugins. diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 1a6b64e858..152afb4b9d 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -392,7 +392,7 @@ func Test_motionforce_omap() endfunc func Test_error_in_map_expr() - if !has('terminal') || has('gui_running') + if !has('terminal') || (has('win32') && has('gui_running')) throw 'Skipped: cannot run Vim in a terminal window' endif @@ -406,7 +406,7 @@ func Test_error_in_map_expr() [CODE] call writefile(lines, 'Xtest.vim') - let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8}) + let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8}) let job = term_getjob(buf) call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))}) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index ddf0ec61b2..13971a918d 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -341,7 +341,7 @@ func Test_nocatch_garbage_collect() endfunc func Test_error_in_timer_callback() - if !has('terminal') || has('gui_running') + if !has('terminal') || (has('win32') && has('gui_running')) throw 'Skipped: cannot run Vim in a terminal window' endif @@ -355,7 +355,7 @@ func Test_error_in_timer_callback() [CODE] call writefile(lines, 'Xtest.vim') - let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8}) + let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8}) let job = term_getjob(buf) call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))}) -- cgit