From f3c242c13cc9aaefd29f750d211fff76e1fada68 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 31 Dec 2020 19:56:15 -0500 Subject: vim-patch:8.1.1241: Ex command info contains confusing information Problem: Ex command info contains confusing information. Solution: When using the NOTADR flag use ADDR_OTHER for the address type. Cleanup code using NOTADR. Check for errors in create_cmdidxs.vim. Adjust Makefile to see the errors. https://github.com/vim/vim/commit/b731689e85b4153af7edc8f0a6b9f99d36d8b011 Use Lua's "assert()" to make an invalid command definition a compilation error. Misc changes: Remove 'RESTRICT' flag. Neovim does not support "restricted" mode since commit 7777532cebcfa9abc5ab2c7beae77f386feed3ca. TODO: Do not generate files before Lua assertions so that CMake always runs the generator script if the previous build has an invalid command definition. --- src/nvim/testdir/test_usercommands.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim index 0a89066a2b..4621207d19 100644 --- a/src/nvim/testdir/test_usercommands.vim +++ b/src/nvim/testdir/test_usercommands.vim @@ -393,9 +393,13 @@ func Test_addr_all() call assert_equal(len(gettabinfo()), g:a2) bwipe - command! -addr=other DoSomething echo 'nothing' + command! -addr=other DoSomething let g:a1 = | let g:a2 = DoSomething - call assert_fails('%DoSomething') + call assert_equal(line('.'), g:a1) + call assert_equal(line('.'), g:a2) + %DoSomething + call assert_equal(1, g:a1) + call assert_equal(line('$'), g:a2) delcommand DoSomething endfunc @@ -421,7 +425,7 @@ func Test_command_list() \ execute('command DoCmd')) command! -count=2 DoCmd : call assert_equal("\n Name Args Address Complete Definition" - \ .. "\n DoCmd 0 2c :", + \ .. "\n DoCmd 0 2c ? :", \ execute('command DoCmd')) " Test with various -addr= argument values. -- cgit From 35dc6d6e876c6726089338ed0a61191315deb537 Mon Sep 17 00:00:00 2001 From: erw7 Date: Tue, 13 Oct 2020 10:02:36 +0900 Subject: vim-patch:8.1.1261: no error for quickfix commands with negative range Problem: No error for quickfix commands with negative range. Solution: Add ADDR_UNSIGNED and use it for quickfix commands. Make assert_fails() show the command if the error doesn't match. https://github.com/vim/vim/commit/25190db225d63e185e77e043e694ef455b3cf304 N/A patches for version.c: vim-patch:8.2.0113: "make cmdidxs" fails Problem: "make cmdidxs" fails. Solution: Allow address for ":cquit". Add --not-a-term to avoid a delay. https://github.com/vim/vim/commit/9b24dfcb9f676e7f7a09a9062f0d05b2104a87eb --- src/nvim/testdir/test_quickfix.vim | 48 +++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 563dbd90d9..49d66d8c1f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -29,7 +29,7 @@ func s:setup_commands(cchar) command! -count -nargs=* -bang Xprev cprev command! -nargs=* -bang Xfirst cfirst command! -nargs=* -bang Xlast clast - command! -nargs=* -bang -range Xnfile cnfile + command! -count -nargs=* -bang Xnfile cnfile command! -nargs=* -bang Xpfile cpfile command! -nargs=* Xexpr cexpr command! -range -nargs=* Xvimgrep vimgrep @@ -64,7 +64,7 @@ func s:setup_commands(cchar) command! -count -nargs=* -bang Xprev lprev command! -nargs=* -bang Xfirst lfirst command! -nargs=* -bang Xlast llast - command! -nargs=* -bang -range Xnfile lnfile + command! -count -nargs=* -bang Xnfile lnfile command! -nargs=* -bang Xpfile lpfile command! -nargs=* Xexpr lexpr command! -range -nargs=* Xvimgrep lvimgrep @@ -4286,13 +4286,9 @@ func Xtest_below(cchar) " Invalid range if a:cchar == 'c' - call assert_fails('-2cbelow', 'E553:') - " TODO: should go to first error in the current line? - 0cabove + call assert_fails('-2cbelow', 'E16:') else - call assert_fails('-2lbelow', 'E553:') - " TODO: should go to first error in the current line? - 0labove + call assert_fails('-2lbelow', 'E16:') endif call delete('X1') @@ -4306,6 +4302,42 @@ func Test_cbelow() call Xtest_below('l') endfunc +func Test_quickfix_count() + let commands = [ + \ 'cNext', + \ 'cNfile', + \ 'cabove', + \ 'cbelow', + \ 'cfirst', + \ 'clast', + \ 'cnewer', + \ 'cnext', + \ 'cnfile', + \ 'colder', + \ 'cprevious', + \ 'crewind', + \ + \ 'lNext', + \ 'lNfile', + \ 'labove', + \ 'lbelow', + \ 'lfirst', + \ 'llast', + \ 'lnewer', + \ 'lnext', + \ 'lnfile', + \ 'lolder', + \ 'lprevious', + \ 'lrewind', + \ ] + for cmd in commands + call assert_fails('-1' .. cmd, 'E16:') + call assert_fails('.' .. cmd, 'E16:') + call assert_fails('%' .. cmd, 'E16:') + call assert_fails('$' .. cmd, 'E16:') + endfor +endfunc + " Test for aborting quickfix commands using QuickFixCmdPre func Xtest_qfcmd_abort(cchar) call s:setup_commands(a:cchar) -- cgit From d1608f7503512b37650522cf5c8a3dce7add5e3b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 03:32:43 -0500 Subject: vim-patch:8.1.1275: cannot navigate to errors before/after the cursor Problem: Cannot navigate to errors before/after the cursor. Solution: Add the :cbefore and :cafter commands. (Yegappan Lakshmanan, closes vim/vim#4340) https://github.com/vim/vim/commit/cf6a55c4b0cbf38b0c3fbed5ffd9a3fd0d2ede0e --- src/nvim/testdir/test_quickfix.vim | 71 +++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 49d66d8c1f..f9d1abeaec 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -40,6 +40,8 @@ func s:setup_commands(cchar) command! -nargs=0 -count Xcc cc command! -count=1 -nargs=0 Xbelow cbelow command! -count=1 -nargs=0 Xabove cabove + command! -count=1 -nargs=0 Xbefore cbefore + command! -count=1 -nargs=0 Xafter cafter let g:Xgetlist = function('getqflist') let g:Xsetlist = function('setqflist') call setqflist([], 'f') @@ -75,6 +77,8 @@ func s:setup_commands(cchar) command! -nargs=0 -count Xcc ll command! -count=1 -nargs=0 Xbelow lbelow command! -count=1 -nargs=0 Xabove labove + command! -count=1 -nargs=0 Xbefore lbefore + command! -count=1 -nargs=0 Xafter lafter let g:Xgetlist = function('getloclist', [0]) let g:Xsetlist = function('setloclist', [0]) call setloclist(0, [], 'f') @@ -4201,17 +4205,22 @@ func Test_empty_qfbuf() endfunc " Test for the :cbelow, :cabove, :lbelow and :labove commands. +" And for the :cafter, :cbefore, :lafter and :lbefore commands. func Xtest_below(cchar) call s:setup_commands(a:cchar) " No quickfix/location list call assert_fails('Xbelow', 'E42:') call assert_fails('Xabove', 'E42:') + call assert_fails('Xbefore', 'E42:') + call assert_fails('Xafter', 'E42:') " Empty quickfix/location list call g:Xsetlist([]) call assert_fails('Xbelow', 'E42:') call assert_fails('Xabove', 'E42:') + call assert_fails('Xbefore', 'E42:') + call assert_fails('Xafter', 'E42:') call s:create_test_file('X1') call s:create_test_file('X2') @@ -4225,39 +4234,74 @@ func Xtest_below(cchar) call assert_fails('Xabove', 'E42:') call assert_fails('3Xbelow', 'E42:') call assert_fails('4Xabove', 'E42:') + call assert_fails('Xbefore', 'E42:') + call assert_fails('Xafter', 'E42:') + call assert_fails('3Xbefore', 'E42:') + call assert_fails('4Xafter', 'E42:') " Test the commands with various arguments - Xexpr ["X1:5:L5", "X2:5:L5", "X2:10:L10", "X2:15:L15", "X3:3:L3"] + Xexpr ["X1:5:3:L5", "X2:5:2:L5", "X2:10:3:L10", "X2:15:4:L15", "X3:3:5:L3"] edit +7 X2 Xabove call assert_equal(['X2', 5], [bufname(''), line('.')]) call assert_fails('Xabove', 'E553:') + normal 7G + Xbefore + call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')]) + call assert_fails('Xbefore', 'E553:') + normal 2j Xbelow call assert_equal(['X2', 10], [bufname(''), line('.')]) + normal 7G + Xafter + call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')]) + " Last error in this file Xbelow 99 call assert_equal(['X2', 15], [bufname(''), line('.')]) call assert_fails('Xbelow', 'E553:') + normal gg + Xafter 99 + call assert_equal(['X2', 15, 4], [bufname(''), line('.'), col('.')]) + call assert_fails('Xafter', 'E553:') + " First error in this file Xabove 99 call assert_equal(['X2', 5], [bufname(''), line('.')]) call assert_fails('Xabove', 'E553:') + normal G + Xbefore 99 + call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')]) + call assert_fails('Xbefore', 'E553:') + normal gg Xbelow 2 call assert_equal(['X2', 10], [bufname(''), line('.')]) + normal gg + Xafter 2 + call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')]) + normal G Xabove 2 call assert_equal(['X2', 10], [bufname(''), line('.')]) + normal G + Xbefore 2 + call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')]) + edit X4 call assert_fails('Xabove', 'E42:') call assert_fails('Xbelow', 'E42:') + call assert_fails('Xbefore', 'E42:') + call assert_fails('Xafter', 'E42:') if a:cchar == 'l' " If a buffer has location list entries from some other window but not " from the current window, then the commands should fail. edit X1 | split | call setloclist(0, [], 'f') call assert_fails('Xabove', 'E776:') call assert_fails('Xbelow', 'E776:') + call assert_fails('Xbefore', 'E776:') + call assert_fails('Xafter', 'E776:') close endif @@ -4268,27 +4312,52 @@ func Xtest_below(cchar) edit +1 X2 Xbelow 2 call assert_equal(['X2', 10, 1], [bufname(''), line('.'), col('.')]) + normal 1G + Xafter 2 + call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')]) + normal gg Xbelow 99 call assert_equal(['X2', 15, 1], [bufname(''), line('.'), col('.')]) + normal gg + Xafter 99 + call assert_equal(['X2', 15, 3], [bufname(''), line('.'), col('.')]) + normal G Xabove 2 call assert_equal(['X2', 10, 1], [bufname(''), line('.'), col('.')]) + normal G + Xbefore 2 + call assert_equal(['X2', 15, 2], [bufname(''), line('.'), col('.')]) + normal G Xabove 99 call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')]) + normal G + Xbefore 99 + call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')]) + normal 10G Xabove call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')]) + normal 10G$ + 2Xbefore + call assert_equal(['X2', 10, 2], [bufname(''), line('.'), col('.')]) + normal 10G Xbelow call assert_equal(['X2', 15, 1], [bufname(''), line('.'), col('.')]) + normal 9G + 5Xafter + call assert_equal(['X2', 15, 2], [bufname(''), line('.'), col('.')]) " Invalid range if a:cchar == 'c' call assert_fails('-2cbelow', 'E16:') + call assert_fails('-2cafter', 'E16:') else call assert_fails('-2lbelow', 'E16:') + call assert_fails('-2lafter', 'E16:') endif call delete('X1') -- cgit From d7b577d6ab38da8f199a616707a666c43e252ce3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 04:47:35 -0500 Subject: vim-patch:8.1.1281: cannot specify a count with :chistory Problem: Cannot specify a count with :chistory. Solution: Add a count to :chistory and :lhistory. (Yegappan Lakshmanan, closes vim/vim#4344) https://github.com/vim/vim/commit/8ffc7c8b5f004971cb6f2bdcfbe4f7123cce717c --- src/nvim/testdir/test_quickfix.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index f9d1abeaec..3646d37f9c 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -1918,9 +1918,23 @@ func HistoryTest(cchar) call assert_equal(' error list 2 of 3; 2 ' . common, res[1]) call assert_equal('> error list 3 of 3; 3 ' . common, res[2]) + " Test for changing the quickfix lists + call assert_equal(3, g:Xgetlist({'nr' : 0}).nr) + exe '1' . a:cchar . 'hist' + call assert_equal(1, g:Xgetlist({'nr' : 0}).nr) + exe '3' . a:cchar . 'hist' + call assert_equal(3, g:Xgetlist({'nr' : 0}).nr) + call assert_fails('-2' . a:cchar . 'hist', 'E16:') + call assert_fails('4' . a:cchar . 'hist', 'E16:') + call g:Xsetlist([], 'f') let l = split(execute(a:cchar . 'hist'), "\n") call assert_equal('No entries', l[0]) + if a:cchar == 'c' + call assert_fails('4chist', 'E16:') + else + call assert_fails('4lhist', 'E776:') + endif " An empty list should still show the stack history call g:Xsetlist([]) -- cgit From 134ea0c935dd04e04d28c4a36161872345f66bf3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 13:10:08 -0500 Subject: vim-patch:8.1.2360: quickfix test coverage can still be improved Problem: Quickfix test coverage can still be improved. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5276) https://github.com/vim/vim/commit/15a7bdcb77faabbd3a9a889957f810da2bcda13e --- src/nvim/testdir/test_quickfix.vim | 67 +++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 9 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 3646d37f9c..2b00f828f7 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -264,6 +264,9 @@ func XwindowTests(cchar) \ winheight('.') == 7 && \ getline('.') ==# '|| non-error 1') + " :cnext in quickfix window should move to the next entry + Xnext + call assert_equal(2, g:Xgetlist({'idx' : 0}).idx) " Calling cwindow should close the quickfix window with no valid errors Xwindow @@ -435,13 +438,19 @@ func Xtest_browse(cchar) " result in failure if a:cchar == 'c' let err = 'E42:' + let cmd = '$cc' else let err = 'E776:' + let cmd = '$ll' endif call assert_fails('Xnext', err) call assert_fails('Xprev', err) call assert_fails('Xnfile', err) call assert_fails('Xpfile', err) + call assert_fails(cmd, err) + + Xexpr '' + call assert_fails(cmd, 'E42:') call s:create_test_file('Xqftestfile1') call s:create_test_file('Xqftestfile2') @@ -1814,14 +1823,27 @@ func s:test_xgrep(cchar) enew! | only set makeef&vim silent Xgrep Grep_Test_Text: test_quickfix.vim - call assert_true(len(g:Xgetlist()) == 3) + call assert_true(len(g:Xgetlist()) == 5) Xopen call assert_true(w:quickfix_title =~ '^:grep') Xclose enew set makeef=Temp_File_## silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim - call assert_true(len(g:Xgetlist()) == 6) + + " Try with 'grepprg' set to 'internal' + set grepprg=internal + silent Xgrep Grep_Test_Text: test_quickfix.vim + silent Xgrepadd GrepAdd_Test_Text: test_quickfix.vim + call assert_true(len(g:Xgetlist()) == 9) + set grepprg&vim + + call writefile(['Vim'], 'XtestTempFile') + set makeef=XtestTempFile + silent Xgrep Grep_Test_Text: test_quickfix.vim + call assert_equal(5, len(g:Xgetlist())) + call assert_false(filereadable('XtestTempFile')) + set makeef&vim endfunc func Test_grep() @@ -2383,14 +2405,28 @@ func Test_Autocmd() silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim silent grep abc123def Xtest silent grepadd abc123def Xtest + set grepprg=internal + silent grep Grep_Autocmd_Text test_quickfix.vim + silent grepadd GrepAdd_Autocmd_Text test_quickfix.vim + silent lgrep Grep_Autocmd_Text test_quickfix.vim + silent lgrepadd GrepAdd_Autocmd_Text test_quickfix.vim + set grepprg&vim let l = ['pregrep', - \ 'postgrep', - \ 'pregrepadd', - \ 'postgrepadd', - \ 'pregrep', - \ 'postgrep', - \ 'pregrepadd', - \ 'postgrepadd'] + \ 'postgrep', + \ 'pregrepadd', + \ 'postgrepadd', + \ 'pregrep', + \ 'postgrep', + \ 'pregrepadd', + \ 'postgrepadd', + \ 'pregrep', + \ 'postgrep', + \ 'pregrepadd', + \ 'postgrepadd', + \ 'prelgrep', + \ 'postlgrep', + \ 'prelgrepadd', + \ 'postlgrepadd'] call assert_equal(l, g:acmds) endif @@ -2509,6 +2545,19 @@ func Test_cwindow_jump() call assert_true(winnr('$') == 2) call assert_true(winnr() == 1) + " Jumping to a file from the location list window should find a usuable + " window by wrapping around the window list. + enew | only + call setloclist(0, [], 'f') + new | new + lgetexpr ["F1%10%Line 10", "F2%20%Line 20", "F3%30%Line 30"] + lopen + 1close + call assert_equal(0, getloclist(3, {'id' : 0}).id) + lnext + call assert_equal(3, winnr()) + call assert_equal(getloclist(1, {'id' : 0}).id, getloclist(3, {'id' : 0}).id) + enew | only set efm&vim endfunc -- cgit From 86ae394aeb6f2223f5e9a4e98bc9ee1dcbe130dd Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 13:25:39 -0500 Subject: vim-patch:8.2.0934: lhelpgrep twice in help window doesn't jump to the help topic Problem: Running lhelpgrep twice in a help window doesn't jump to the help topic. Solution: Check whether any window with the location list is present. (Yegappan Lakshmanan, closes vim/vim#6215) https://github.com/vim/vim/commit/ec98e93a82379ca9289d8021aec374aa6798afef --- src/nvim/testdir/test_quickfix.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 2b00f828f7..be7ea908c7 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -4625,6 +4625,24 @@ func Test_cquit() call assert_fails('-3cquit', 'E16:') endfunc +" Running :lhelpgrep command more than once in a help window, doesn't jump to +" the help topic +func Test_lhelpgrep_from_help_window() + call mkdir('Xtestdir/doc', 'p') + call writefile(['window'], 'Xtestdir/doc/a.txt') + call writefile(['buffer'], 'Xtestdir/doc/b.txt') + let save_rtp = &rtp + let &rtp = 'Xtestdir' + lhelpgrep window + lhelpgrep buffer + call assert_equal('b.txt', fnamemodify(@%, ":p:t")) + lhelpgrep window + call assert_equal('a.txt', fnamemodify(@%, ":p:t")) + let &rtp = save_rtp + call delete('Xtestdir', 'rf') + new | only! +endfunc + " Test for adding an invalid entry with the quickfix window open and making " sure that the window contents are not changed func Test_add_invalid_entry_with_qf_window() -- cgit From b580cf83bd8afba2c107f262bedcfa9bef73cfbb Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 16:17:48 -0500 Subject: vim-patch:8.2.2258: not all OCaml related files are detected Problem: Not all OCaml related files are detected. Solution: Update OCaml file type detection. (Markus Mottl, closes vim/vim#7590) https://github.com/vim/vim/commit/beef4eeda5c6865fcfe46db43ae71429a2025b58 --- src/nvim/testdir/test_filetype.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index 2123780f11..1cb68e7fef 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -150,6 +150,7 @@ let s:filename_checks = { \ 'dsl': ['file.dsl'], \ 'dtd': ['file.dtd'], \ 'dts': ['file.dts', 'file.dtsi'], + \ 'dune': ['jbuild', 'dune', 'dune-project', 'dune-workspace'], \ 'dylan': ['file.dylan'], \ 'dylanintr': ['file.intr'], \ 'dylanlid': ['file.lid'], @@ -322,9 +323,10 @@ let s:filename_checks = { \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom'], \ 'nsis': ['file.nsi', 'file.nsh'], \ 'obj': ['file.obj'], - \ 'ocaml': ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit'], + \ 'ocaml': ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit', 'file.mlt', 'file.mlp', 'file.mlip', 'file.mli.cppo', 'file.ml.cppo'], \ 'occam': ['file.occ'], \ 'omnimark': ['file.xom', 'file.xin'], + \ 'opam': ['opam', 'file.opam', 'file.opam.template'], \ 'openroad': ['file.or'], \ 'ora': ['file.ora'], \ 'pamconf': ['/etc/pam.conf'], @@ -398,6 +400,7 @@ let s:filename_checks = { \ 'scheme': ['file.scm', 'file.ss', 'file.rkt'], \ 'scilab': ['file.sci', 'file.sce'], \ 'screen': ['.screenrc', 'screenrc'], + \ 'sexplib': ['file.sexp'], \ 'scss': ['file.scss'], \ 'sd': ['file.sd'], \ 'sdc': ['file.sdc'], -- cgit From 85c658e388667f682c1e743a7ccc8424b942a7f4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 16:20:04 -0500 Subject: vim-patch:8.2.2260: window resize test fails in very wide terminal Problem: Window resize test fails in very wide terminal. Solution: Resize using the 'columns' option. (Vladimir Lomov, closes vim/vim#7592) https://github.com/vim/vim/commit/5efe0e5d16db070f0ab0b944686139e597afe166 --- src/nvim/testdir/test_window_cmd.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index bed39d0741..687b1cb989 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -856,7 +856,7 @@ func Test_window_resize() wincmd l let other_winnr = winnr('h') call assert_notequal(winnr(), other_winnr) - exe 'vert ' .. other_winnr .. 'resize -100' + exe 'vert ' .. other_winnr .. 'resize -' .. &columns call assert_equal(0, winwidth(other_winnr)) %bwipe! -- cgit From 60855116f0acf79d74302602d910b7c2fb4dffc7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 16:22:08 -0500 Subject: vim-patch:8.2.0388: printmbcharset option not tested Problem: Printmbcharset option not tested. Solution: Add a test. Enable PostScript for AppVeyor build. (Dominique Pelle, closes vim/vim#5783) https://github.com/vim/vim/commit/833805a4867cf5f93b3ef91227d1f1a98f553dff --- src/nvim/testdir/test_hardcopy.vim | 69 ++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 21 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim index 6125f9b993..63b4d888d7 100644 --- a/src/nvim/testdir/test_hardcopy.vim +++ b/src/nvim/testdir/test_hardcopy.vim @@ -1,5 +1,7 @@ " Test :hardcopy +source check.vim + func Test_printoptions() edit test_hardcopy.vim syn on @@ -28,7 +30,7 @@ func Test_printoptions() \ ''] exe 'set printoptions=' .. opt if has('postscript') - hardcopy > Xhardcopy_printoptions + 1,50hardcopy > Xhardcopy_printoptions let lines = readfile('Xhardcopy_printoptions') call assert_true(len(lines) > 20, opt) call assert_true(lines[0] =~ 'PS-Adobe', opt) @@ -63,10 +65,34 @@ func Test_printmbfont() bwipe endfunc +func Test_printmbcharset() + CheckFeature postscript + + " digraph.txt has plenty of non-latin1 characters. + help digraph.txt + set printmbcharset=ISO10646 printencoding=utf-8 printmbfont=r:WadaMin-Regular + + hardcopy > Xhardcopy_printmbcharset + let lines = readfile('Xhardcopy_printmbcharset') + call assert_true(len(lines) > 20) + call assert_true(lines[0] =~ 'PS-Adobe') + + set printmbcharset=does-not-exist printencoding=utf-8 printmbfont=r:WadaMin-Regular + call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E456:') + + set printmbcharset=GB_2312-80 printencoding=utf-8 printmbfont=r:WadaMin-Regular + call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E673:') + + set printmbcharset=ISO10646 printencoding=utf-8 printmbfont= + call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E675:') + + call delete('Xhardcopy_printmbcharset') + set printmbcharset& printencoding& printmbfont& + bwipe +endfunc + func Test_printexpr() - if !has('unix') - return - endif + CheckFeature postscript " Not a very useful printexpr value, but enough to test " hardcopy with 'printexpr'. @@ -84,7 +110,7 @@ func Test_printexpr() \ readfile('Xhardcopy_printexpr')) call delete('Xhardcopy_printexpr') - " Function return 1 to test print failure. + " Function returns 1 to test print failure. function PrintFails(fname) call delete(a:fname) return 1 @@ -97,12 +123,11 @@ func Test_printexpr() endfunc func Test_errors() - " FIXME: Windows fails differently than Unix. - if has('unix') - edit test_hardcopy.vim - call assert_fails('hardcopy >', 'E324:') - bwipe - endif + CheckFeature postscript + + edit test_hardcopy.vim + call assert_fails('hardcopy >', 'E324:') + bwipe endfunc func Test_dark_background() @@ -126,12 +151,11 @@ func Test_dark_background() endfun func Test_empty_buffer() - " FIXME: Unclear why this fails on Windows. - if has('unix') - new - call assert_equal("\nNo text to be printed", execute('hardcopy')) - bwipe - endif + CheckFeature postscript + + new + call assert_equal("\nNo text to be printed", execute('hardcopy')) + bwipe endfunc func Test_printheader_parsing() @@ -145,9 +169,8 @@ func Test_printheader_parsing() endfunc func Test_fname_with_spaces() - if !has('postscript') - return - endif + CheckFeature postscript + split t\ e\ s\ t.txt call setline(1, ['just', 'some', 'text']) hardcopy > %.ps @@ -157,9 +180,11 @@ func Test_fname_with_spaces() endfunc func Test_illegal_byte() - if !has('postscript') || &enc != 'utf-8' + CheckFeature postscript + if &enc != 'utf-8' return endif + new " conversion of 0xff will fail, this used to cause a crash call setline(1, "\xff") @@ -168,3 +193,5 @@ func Test_illegal_byte() bwipe! call delete('Xpstest') endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From fc191352e958cae0b598e4bec859b4e53034799c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 1 Jan 2021 16:24:29 -0500 Subject: vim-patch:8.2.2269: not all :hardcopy code covered by tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Not all :hardcopy code covered by tests. Solution: Test more combinations. (Dominique Pellé, closes vim/vim#7595) https://github.com/vim/vim/commit/edc10b541b468f5f5aa2e2d5ef58a3e17e043bff --- src/nvim/testdir/test_hardcopy.vim | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim index 63b4d888d7..e390bd5cc8 100644 --- a/src/nvim/testdir/test_hardcopy.vim +++ b/src/nvim/testdir/test_hardcopy.vim @@ -10,8 +10,10 @@ func Test_printoptions() \ 'left:2in,top:30pt,right:16mm,bottom:3pc', \ 'header:3,syntax:y,number:y,wrap:n', \ 'header:3,syntax:n,number:y,wrap:y', + \ 'header:0,syntax:a,number:y,wrap:y', \ 'duplex:short,collate:n,jobsplit:y,portrait:n', \ 'duplex:long,collate:y,jobsplit:n,portrait:y', + \ 'duplex:off,collate:y,jobsplit:y,portrait:y', \ 'paper:10x14', \ 'paper:A3', \ 'paper:A4', @@ -46,8 +48,8 @@ func Test_printoptions() endfunc func Test_printmbfont() - " Print a small help page which contains tabs to cover code that expands tabs to spaces. - help help + " Print a help page which contains tabs, underlines (etc) to recover more code. + help syntax.txt syn on for opt in [':WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no', @@ -70,12 +72,17 @@ func Test_printmbcharset() " digraph.txt has plenty of non-latin1 characters. help digraph.txt - set printmbcharset=ISO10646 printencoding=utf-8 printmbfont=r:WadaMin-Regular - - hardcopy > Xhardcopy_printmbcharset - let lines = readfile('Xhardcopy_printmbcharset') - call assert_true(len(lines) > 20) - call assert_true(lines[0] =~ 'PS-Adobe') + set printmbcharset=ISO10646 printencoding=utf-8 + for courier in ['yes', 'no'] + for ascii in ['yes', 'no'] + exe 'set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-BoldItalic' + \ .. ',c:' .. courier .. ',a:' .. ascii + hardcopy > Xhardcopy_printmbcharset + let lines = readfile('Xhardcopy_printmbcharset') + call assert_true(len(lines) > 20) + call assert_true(lines[0] =~ 'PS-Adobe') + endfor + endfor set printmbcharset=does-not-exist printencoding=utf-8 printmbfont=r:WadaMin-Regular call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E456:') -- cgit