diff options
508 files changed, 1179 insertions, 730 deletions
diff --git a/runtime/compiler/pandoc.vim b/runtime/compiler/pandoc.vim index a536257eba..1b171a1cb8 100644 --- a/runtime/compiler/pandoc.vim +++ b/runtime/compiler/pandoc.vim @@ -9,10 +9,6 @@ if exists("current_compiler") finish endif -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif - let s:keepcpo = &cpo set cpo&vim @@ -40,9 +36,9 @@ silent! function s:PandocFiletype(filetype) abort elseif ft ==# 'text' || empty(ft) return 'markdown' elseif index(s:supported_filetypes, &ft) >= 0 - return ft + return ft else - echomsg 'Unsupported filetype: ' . a:filetype ', falling back to Markdown as input format!' + echomsg 'Unsupported filetype: ' . ft . ', falling back to Markdown as input format!' return 'markdown' endif endfunction diff --git a/runtime/compiler/vimdoc.vim b/runtime/compiler/vimdoc.vim new file mode 100644 index 0000000000..d83b924177 --- /dev/null +++ b/runtime/compiler/vimdoc.vim @@ -0,0 +1,19 @@ +" Vim Compiler File +" Language: vimdoc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Latest Revision: 2024-04-09 +" +" you can get it by `pip install vimdoc` or the package manager of your distribution. + +if exists('b:current_compiler') + finish +endif +let b:current_compiler = 'vimdoc' + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +CompilerSet makeprg=vimdoc + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/doc/dev_vimpatch.txt b/runtime/doc/dev_vimpatch.txt index 5cc7a70ba2..1f48324d46 100644 --- a/runtime/doc/dev_vimpatch.txt +++ b/runtime/doc/dev_vimpatch.txt @@ -204,7 +204,6 @@ information. mb_ptr2char utf_ptr2char mb_head_off utf_head_off mb_tail_off utf_cp_bounds - mb_strnicmp2 utf_strnicmp mb_lefthalve grid_lefthalve mb_fix_col grid_fix_col utf_off2cells grid_off2cells diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 1a4572e94a..662d89895d 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -632,9 +632,12 @@ list of the current window. :[count]arge[dit][!] [++opt] [+cmd] {name} .. *:arge* *:argedit* Add {name}s to the argument list and edit it. - When {name} already exists in the argument list, this - entry is edited. - This is like using |:argadd| and then |:edit|. + There is no check for duplicates, it is possible to + add a file to the argument list twice |:argded|. + This is like using |:argadd| and then |:edit| (with + the small exception that |:edit| does not change the + argument list, so the argument list pointer isn't + changed). Spaces in filenames have to be escaped with "\". [count] is used like with |:argadd|. If the current file cannot be |abandon|ed {name}s will @@ -653,12 +656,12 @@ list of the current window. If the argument list is "a b c", and "b" is the current argument, then these commands result in: command new argument list ~ - :argadd x a b x c - :0argadd x x a b c - :1argadd x a x b c - :$argadd x a b c x + :argadd x a [b] x c + :0argadd x x a [b] c + :1argadd x a x [b] c + :$argadd x a [b] c x And after the last one: - :+2argadd y a b c x y + :+2argadd y a [b] c x y There is no check for duplicates, it is possible to add a file to the argument list twice. You can use |:argdedupe| to fix it afterwards: > diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index efcc6afae9..46b3ab507d 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -305,7 +305,7 @@ Hints for translators: using the "tag@en" notation. - Make a package with all the files and the tags file available for download. Users can drop it in one of the "doc" directories and start use it. - Report this to Bram, so that he can add a link on www.vim.org. + Report to the development team, so they can add a link on www.vim.org. - Use the |:helptags| command to generate the tags files. It will find all languages in the specified directory. diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index c9211291d0..4c757cc1f6 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -69,11 +69,11 @@ If Nvim crashes, try to get a backtrace. See |debug.txt|. Sponsor Vim/Nvim development *sponsor* *register* Fixing bugs and adding new features takes a lot of time and effort. To show -your appreciation for the work and motivate Bram and others to continue -working on Vim please send a donation. +your appreciation for the work and motivate developers to continue working on +Vim please send a donation. -Since Bram is back to a paid job the money will now be used to help children -in Uganda. See |uganda|. But at the same time donations increase Bram's +The money you donated will be mainly used to help children in Uganda. See +|uganda|. But at the same time donations increase the development team motivation to keep working on Vim! For the most recent information about sponsoring look on the Vim web site: diff --git a/runtime/ftplugin/asm.vim b/runtime/ftplugin/asm.vim index f6a92d57d7..0ae1610394 100644 --- a/runtime/ftplugin/asm.vim +++ b/runtime/ftplugin/asm.vim @@ -1,13 +1,23 @@ " Vim filetype plugin file " Language: asm " Maintainer: Colin Caine <cmcaine at the common googlemail domain> -" Last Change: 23 May 2020 +" Last Change: 2020 May 23 " 2023 Aug 28 by Vim Project (undo_ftplugin) +" 2024 Apr 09 by Vim Project (add Matchit support) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 +setl include=^\\s*%\\s*include setl comments=:;,s1:/*,mb:*,ex:*/,:// setl commentstring=;%s -let b:undo_ftplugin = "setl commentstring< comments<" +let b:undo_ftplugin = "setl commentstring< comments< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_skip = 's:comment\|string\|character\|special' + let b:match_words = '^\s*%\s*if\%(\|num\|idn\|nidn\)\>:^\s*%\s*elif\>:^\s*%\s*else\>:^\s*%\s*endif\>,^\s*%\s*macro\>:^\s*%\s*endmacro\>,^\s*%\s*rep\>:^\s*%\s*endrep\>' + let b:match_ignorecase = 1 + let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:match_skip" +endif diff --git a/runtime/ftplugin/bp.vim b/runtime/ftplugin/bp.vim new file mode 100644 index 0000000000..cb925cb0ec --- /dev/null +++ b/runtime/ftplugin/bp.vim @@ -0,0 +1,14 @@ +" Blueprint build system filetype plugin file +" Language: Blueprint +" Maintainer: Bruno BELANYI <bruno.vim@belanyi.fr> +" Latest Revision: 2024-04-10 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=b:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/ftplugin/cgdbrc.vim b/runtime/ftplugin/cgdbrc.vim new file mode 100644 index 0000000000..46cf135c5c --- /dev/null +++ b/runtime/ftplugin/cgdbrc.vim @@ -0,0 +1,21 @@ +" Vim filetype plugin file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +let b:undo_ftplugin = 'setl com< cms<' + +setlocal commentstring=#%s +setlocal comments=:# + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions diff --git a/runtime/ftplugin/gdb.vim b/runtime/ftplugin/gdb.vim index 2473b13af0..7c10633be4 100644 --- a/runtime/ftplugin/gdb.vim +++ b/runtime/ftplugin/gdb.vim @@ -1,12 +1,20 @@ " Vim filetype plugin file " Language: gdb " Maintainer: Michaël Peeters <NOSPAMm.vim@noekeon.org> -" Last Changed: 26 Oct 2017 +" Last Changed: 2017-10-26 +" 2024-04-10: - add Matchit support (by Vim Project) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 setlocal commentstring=#%s +setlocal include=^\\s*source " Undo the stuff we changed. -let b:undo_ftplugin = "setlocal cms<" +let b:undo_ftplugin = "setlocal cms< include<" + +" Matchit support +if !exists('b:match_words') + let b:match_words = '\<\%(if\|while\|define\|document\)\>:\<else\>:\<end\>' + let b:undo_ftplugin ..= " | unlet! b:match_words" +endif diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index f5dae0f94e..3f9b4139de 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Vim -" Maintainer: The Vim Project <https://github.com/vim/vim> -" Last Change: 2023 Aug 10 +" Language: Vim +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2024 Apr 08 " Former Maintainer: Bram Moolenaar <Bram@vim.org> " Only do this when not done yet for this buffer @@ -15,6 +15,8 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim +compiler vimdoc + if !exists('*VimFtpluginUndo') func VimFtpluginUndo() setl fo< isk< com< tw< commentstring< keywordprg< @@ -50,7 +52,7 @@ setlocal isk+=# setlocal keywordprg=:help " Comments starts with # in Vim9 script. We have to guess which one to use. -if "\n" .. getline(1, 10)->join("\n") =~# '\n\s*vim9\%[script]\>' +if "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' setlocal commentstring=#%s else setlocal commentstring=\"%s diff --git a/runtime/indent/asm.vim b/runtime/indent/asm.vim new file mode 100644 index 0000000000..7f848c7b5f --- /dev/null +++ b/runtime/indent/asm.vim @@ -0,0 +1,28 @@ +" Vim indent file +" Language: asm +" Maintainer: Philip Jones <philj56@gmail.com> +" Upstream: https://github.com/philj56/vim-asm-indent +" Latest Revision: 2017-07-01 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal indentexpr=s:getAsmIndent() +setlocal indentkeys=<:>,!^F,o,O + +let b:undo_ftplugin .= "indentexpr< indentkeys<" + +function! s:getAsmIndent() + let line = getline(v:lnum) + let ind = shiftwidth() + + " If the line is a label (starts with ':' terminated keyword), + " then don't indent + if line =~ '^\s*\k\+:' + let ind = 0 + endif + + return ind +endfunction diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua index 90d05f67a5..2f02c2b389 100644 --- a/runtime/lua/vim/_defaults.lua +++ b/runtime/lua/vim/_defaults.lua @@ -93,6 +93,7 @@ do "':normal! @'.getcharstr().'<CR>'", { silent = true, expr = true, desc = ':help v_@-default' } ) + --- Map |gx| to call |vim.ui.open| on the identifier under the cursor do local function do_open(uri) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index bbe1e2c89c..215be7fdc2 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -236,6 +236,7 @@ local extension = { bbclass = 'bitbake', bl = 'blank', blp = 'blueprint', + bp = 'bp', bsd = 'bsdl', bsdl = 'bsdl', bst = 'bst', @@ -252,7 +253,7 @@ local extension = { capnp = 'capnp', cdc = 'cdc', cdl = 'cdl', - toc = 'cdrtoc', + toc = detect_line1('\\contentsline', 'tex', 'cdrtoc'), cfc = 'cf', cfm = 'cf', cfi = 'cf', @@ -582,6 +583,9 @@ local extension = { ['sublime-settings'] = 'json', ['sublime-workspace'] = 'json', ['json-patch'] = 'json', + bd = 'json', + bda = 'json', + xci = 'json', json5 = 'json5', jsonc = 'jsonc', jsonl = 'jsonl', @@ -631,7 +635,7 @@ local extension = { livemd = 'livebook', lgt = 'logtalk', lotos = 'lotos', - lot = 'lotos', + lot = detect_line1('\\contentsline', 'tex', 'lotos'), lout = 'lout', lou = 'lout', ulpc = 'lpc', @@ -770,8 +774,11 @@ local extension = { papp = 'papp', pxml = 'papp', pas = 'pascal', - lpr = 'pascal', + lpr = detect_line1('<%?xml', 'xml', 'pascal'), dpr = 'pascal', + txtpb = 'pbtxt', + textproto = 'pbtxt', + textpb = 'pbtxt', pbtxt = 'pbtxt', g = 'pccts', pcmk = 'pcmk', @@ -1035,6 +1042,27 @@ local extension = { bbl = 'tex', latex = 'tex', sty = 'tex', + pgf = 'tex', + nlo = 'tex', + nls = 'tex', + out = 'tex', + thm = 'tex', + eps_tex = 'tex', + pygtex = 'tex', + pygstyle = 'tex', + clo = 'tex', + aux = 'tex', + brf = 'tex', + ind = 'tex', + lof = 'tex', + loe = 'tex', + nav = 'tex', + vrb = 'tex', + ins = 'tex', + tikz = 'tex', + bbx = 'tex', + cbx = 'tex', + beamer = 'tex', cls = detect.cls, texi = 'texinfo', txi = 'texinfo', @@ -1135,6 +1163,14 @@ local extension = { csproj = 'xml', wpl = 'xml', xmi = 'xml', + xpr = 'xml', + xpfm = 'xml', + spfm = 'xml', + bxml = 'xml', + xcu = 'xml', + xlb = 'xml', + xlc = 'xml', + xba = 'xml', xpm = detect_line1('XPM2', 'xpm2', 'xpm'), xpm2 = 'xpm2', xqy = 'xquery', @@ -1257,7 +1293,9 @@ local filename = { ['/etc/default/cdrdao'] = 'cdrdaoconf', ['/etc/defaults/cdrdao'] = 'cdrdaoconf', ['cfengine.conf'] = 'cfengine', + cgdbrc = 'cgdbrc', ['CMakeLists.txt'] = 'cmake', + ['.cling_history'] = 'cpp', ['.alias'] = detect.csh, ['.cshrc'] = detect.csh, ['.login'] = detect.csh, @@ -1265,6 +1303,8 @@ local filename = { ['csh.login'] = detect.csh, ['csh.logout'] = detect.csh, ['auto.master'] = 'conf', + ['texdoc.cnf'] = 'conf', + ['.x11vncrc'] = 'conf', ['configure.in'] = 'config', ['configure.ac'] = 'config', crontab = 'crontab', @@ -1290,9 +1330,13 @@ local filename = { npmrc = 'dosini', ['/etc/yum.conf'] = 'dosini', ['.npmrc'] = 'dosini', + ['pip.conf'] = 'dosini', ['setup.cfg'] = 'dosini', ['pudb.cfg'] = 'dosini', ['.coveragerc'] = 'dosini', + ['psprint.conf'] = 'dosini', + sofficerc = 'dosini', + ['mimeapps.list'] = 'dosini', ['/etc/pacman.conf'] = 'confini', ['mpv.conf'] = 'confini', dune = 'dune', @@ -1367,6 +1411,7 @@ local filename = { ['ipf.conf'] = 'ipfilter', ['ipf6.conf'] = 'ipfilter', ['ipf.rules'] = 'ipfilter', + ['.node_repl_history'] = 'javascript', ['Pipfile.lock'] = 'json', ['.firebaserc'] = 'json', ['.prettierrc'] = 'json', @@ -1397,12 +1442,14 @@ local filename = { ['.lsl'] = detect.lsl, ['.busted'] = 'lua', ['.luacheckrc'] = 'lua', + ['.lua_history'] = 'lua', ['config.ld'] = 'lua', ['rock_manifest'] = 'lua', ['lynx.cfg'] = 'lynx', ['m3overrides'] = 'm3build', ['m3makefile'] = 'm3build', ['cm3.cfg'] = 'm3quake', + ['.m4_history'] = 'm4', ['.followup'] = 'mail', ['.article'] = 'mail', ['.letter'] = 'mail', @@ -1476,6 +1523,8 @@ local filename = { ['MANIFEST.in'] = 'pymanifest', ['.pythonstartup'] = 'python', ['.pythonrc'] = 'python', + ['.python_history'] = 'python', + ['.jline-jython.history'] = 'python', SConstruct = 'python', qmldir = 'qmldir', ['.Rhistory'] = 'r', @@ -1494,6 +1543,8 @@ local filename = { Puppetfile = 'ruby', ['.irbrc'] = 'ruby', irbrc = 'ruby', + ['.irb_history'] = 'ruby', + irb_history = 'ruby', Vagrantfile = 'ruby', ['smb.conf'] = 'samba', screenrc = 'screen', @@ -1503,6 +1554,7 @@ local filename = { ['/etc/services'] = 'services', ['/etc/serial.conf'] = 'setserial', ['/etc/udev/cdsymlinks.conf'] = 'sh', + ['.ash_history'] = 'sh', ['bash.bashrc'] = detect.bash, bashrc = detect.bash, ['.bashrc'] = detect.bash, @@ -1519,6 +1571,7 @@ local filename = { ['/etc/slp.spi'] = 'slpspi', ['.slrnrc'] = 'slrnrc', ['sendmail.cf'] = 'sm', + ['.sqlite_history'] = 'sql', ['squid.conf'] = 'squid', ['ssh_config'] = 'sshconfig', ['sshd_config'] = 'sshdconfig', @@ -1531,7 +1584,10 @@ local filename = { ['undo.data'] = 'taskdata', ['.tclshrc'] = 'tcl', ['.wishrc'] = 'tcl', + ['.tclsh-history'] = 'tcl', ['tclsh.rc'] = 'tcl', + ['.xsctcmdhistory'] = 'tcl', + ['.xsdbcmdhistory'] = 'tcl', ['texmf.cnf'] = 'texmf', COPYING = 'text', README = 'text', @@ -1549,6 +1605,7 @@ local filename = { ['/.cargo/credentials'] = 'toml', ['Cargo.lock'] = 'toml', ['trustees.conf'] = 'trustees', + ['.ts_node_repl_history'] = 'typescript', ['/etc/udev/udev.conf'] = 'udevconf', ['/etc/updatedb.conf'] = 'updatedb', ['fdrupstream.log'] = 'upstreamlog', @@ -1695,6 +1752,8 @@ local pattern = { ['.*/%.aws/credentials'] = 'confini', ['.*/etc/pacman%.conf'] = 'confini', ['.*/etc/yum%.conf'] = 'dosini', + ['.*/lxqt/.*%.conf'] = 'dosini', + ['.*/screengrab/.*%.conf'] = 'dosini', ['.*lvs'] = 'dracula', ['.*lpe'] = 'dracula', ['.*/dtrace/.*%.d'] = 'dtrace', @@ -2023,6 +2082,7 @@ local pattern = { ['.*termcap.*'] = starsetf(function(path, bufnr) return require('vim.filetype.detect').printcap('term') end), + ['.*/tex/latex/.*%.cfg'] = 'tex', ['.*%.t%.html'] = 'tilde', ['%.?tmux.*%.conf'] = 'tmux', ['%.?tmux.*%.conf.*'] = { 'tmux', { priority = -1 } }, diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index ca2c53b75d..c48984d151 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -458,6 +458,9 @@ end --- @type vim.filetype.mapfn function M.def(_, bufnr) + if getline(bufnr, 1):find('%%%%') then + return 'tex' + end if vim.g.filetype_def == 'modula2' or is_modula2(bufnr) then return modula2(bufnr) end @@ -738,7 +741,9 @@ end --- @type vim.filetype.mapfn function M.inp(_, bufnr) - if getline(bufnr, 1):find('^%*') then + if getline(bufnr, 1):find('%%%%') then + return 'tex' + elseif getline(bufnr, 1):find('^%*') then return 'abaqus' else for _, line in ipairs(getlines(bufnr, 1, 500)) do diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index d2557ca9d7..a2a0c15b93 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -79,7 +79,7 @@ function M.run() local lenses_by_client = lens_cache_by_buf[bufnr] or {} for client, lenses in pairs(lenses_by_client) do for _, lens in pairs(lenses) do - if lens.range.start.line == (line - 1) then + if lens.range.start.line == (line - 1) and lens.command and lens.command.command ~= '' then table.insert(options, { client = client, lens = lens }) end end @@ -231,7 +231,7 @@ local function resolve_lenses(lenses, bufnr, client_id, callback) countdown() else assert(client) - client.request('codeLens/resolve', lens, function(_, result) + client.request(ms.codeLens_resolve, lens, function(_, result) if api.nvim_buf_is_loaded(bufnr) and result and result.command then lens.command = result.command -- Eager display to have some sort of incremental feedback @@ -306,7 +306,11 @@ function M.refresh(opts) textDocument = util.make_text_document_params(buf), } active_refreshes[buf] = true - vim.lsp.buf_request(buf, ms.textDocument_codeLens, params, M.on_codelens) + + local request_ids = vim.lsp.buf_request(buf, ms.textDocument_codeLens, params, M.on_codelens) + if vim.tbl_isempty(request_ids) then + active_refreshes[buf] = nil + end end end end diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua index 8f65cb57c3..990debc77b 100644 --- a/runtime/lua/vim/treesitter/languagetree.lua +++ b/runtime/lua/vim/treesitter/languagetree.lua @@ -1100,7 +1100,14 @@ end ---@param range Range ---@return boolean local function tree_contains(tree, range) - return Range.contains({ tree:root():range() }, range) + local tree_ranges = tree:included_ranges(false) + + return Range.contains({ + tree_ranges[1][1], + tree_ranges[1][2], + tree_ranges[#tree_ranges][3], + tree_ranges[#tree_ranges][4], + }, range) end --- Determines whether {range} is contained in the |LanguageTree|. diff --git a/runtime/syntax/cgdbrc.vim b/runtime/syntax/cgdbrc.vim new file mode 100644 index 0000000000..1ace370d8c --- /dev/null +++ b/runtime/syntax/cgdbrc.vim @@ -0,0 +1,16 @@ +" Vim syntax file +" Language: cgdbrc +" Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu> +" Documentation: https://cgdb.github.io/docs/Configuring-CGDB.html +" Latest Revision: 2024-04-09 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'cgdbrc' + +runtime! syntax/vim.vim + +syn region cgdbComment start="^\s*\#" skip="\\$" end="$" contains=@Spell + +highlight default link cgdbComment Comment diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index f5b1071b2d..4de9cb1425 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -15,6 +15,8 @@ endif let s:keepcpo = &cpo set cpo&vim +let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>' + " vimTodo: contains common special-notices for comments {{{2 " Use the vimCommentGroup cluster to add your own. syn keyword vimTodo contained COMBAK FIXME TODO XXX @@ -146,13 +148,13 @@ endif " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment syn case match " All vimCommands are contained by vimIsCommand. {{{2 @@ -198,7 +200,7 @@ syn keyword vimFTOption contained detect indent off on plugin " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. -syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue +syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd @@ -288,15 +290,21 @@ syn match vimUserType contained "\<\u\w*\>" syn cluster vimType contains=vimType,vimCompoundType,vimUserType -" Keymaps: (Vim Project Addition) {{{2 +" Keymaps: {{{2 " ======= -" TODO: handle Vim9 script comments when something like #13104 is merged -syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment +syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation syn match vimKeymapTailComment "\S.*" contained -syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle + +" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk +if s:vim9script + syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle +endif +syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment syn region vimKeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart @@ -312,9 +320,10 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange +syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter +syn match vimUserCmdName contained "\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite +syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError @@ -337,20 +346,41 @@ syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w* syn case match syn match vimUserAttrbCmplt contained "custom,\u\w*" +syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList + " Lower Priority Comments: after some vim commands... {{{2 " ======================= -syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString -syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' -" Vim9 comments - TODO: might be highlighted while they don't work -syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString -" Vim9 comment inside expression -syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString -syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString +syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' + +if s:vim9script + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comment inside expression + " syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString + " syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString + + syn cluster vimComment contains=vim9Comment +else + syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString + syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString + " Vim9 comments - TODO: might be highlighted while they don't work + syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString contained + " Vim9 comment inside expression + syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained + syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained + + syn cluster vimComment contains=vimComment +endif " Environment Variables: {{{2 " ===================== @@ -440,7 +470,7 @@ syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 -syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod +syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,@vimComment,vimSetString,vimSetMod syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" @@ -473,9 +503,10 @@ syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod " ======= syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList -syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock +syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -616,7 +647,7 @@ if has("conceal") syn match vimSynCcharValue contained "\S" endif -syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment +syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 @@ -705,7 +736,7 @@ syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotatio " Highlighting: {{{2 " ============ -syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment +syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "\D\i*" endif @@ -762,16 +793,21 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= -syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment -syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle -syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +if s:vim9script + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle +else + syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle + syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained +endif syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup -" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match +syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\zs\\" syn match vimContinueComment '^\s*\zs["#]\\ .*' contained syn cluster vimContinue contains=vimContinue,vimContinueComment syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained +syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained " Searches And Globals: {{{2 " ==================== @@ -780,6 +816,17 @@ syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1 +" Vim9 Script Regions: {{{2 +" ================== + +if s:vim9script + syn cluster vimLegacyTop contains=TOP,vimPreVim9script,vim9Comment,vim9LineComment + syn region vimPreVim9script start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment + + syn keyword vim9ScriptArg noclear + syn keyword vimCommand vim9s[cript] nextgroup=vim9ScriptArg skipwhite +endif + " Embedded Scripts: {{{2 " ================ " perl,ruby : Benoit Cerrina @@ -991,6 +1038,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimBufnrWarn vimWarn endif + hi def link vim9ScriptArg Special hi def link vimAbb vimCommand hi def link vimAddress vimMark hi def link vimAugroupBang vimBang @@ -1010,6 +1058,7 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Comment Comment hi def link vimCommentString vimString hi def link vimCommentTitle PreProc + hi def link vim9CommentTitle PreProc hi def link vimCondHL vimCommand hi def link vimConst vimCommand hi def link vimContinue Special @@ -1068,6 +1117,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimHLGroup vimGroup hi def link vimInsert vimString hi def link vimIskSep Delimiter + hi def link vim9KeymapLineComment vimKeymapLineComment hi def link vimKeymapLineComment vimComment hi def link vimKeymapTailComment vimComment hi def link vimLet vimCommand @@ -1192,5 +1242,5 @@ delc VimFoldP delc VimFoldr delc VimFoldt let &cpo = s:keepcpo -unlet s:keepcpo +unlet s:keepcpo s:vim9script " vim:ts=18 fdm=marker ft=vim diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 869fcdf7c0..283f7d9d61 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1030,7 +1030,9 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s has_decor = decor_redraw_line(wp, lnum - 1, &decor_state); - decor_providers_invoke_line(wp, lnum - 1, &has_decor); + if (!end_fill) { + decor_providers_invoke_line(wp, lnum - 1, &has_decor); + } if (has_decor) { extra_check = true; diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c index 72559fe9e0..d82d396d4d 100644 --- a/src/nvim/eval/userfunc.c +++ b/src/nvim/eval/userfunc.c @@ -2578,13 +2578,11 @@ void ex_function(exarg_T *eap) if (checkforcmd(&arg, "let", 2)) { int var_count = 0; int semicolon = 0; - const char *argend = skip_var_list(arg, &var_count, &semicolon, true); - if (argend == NULL) { - // Invalid list assignment: skip to closing bracket. - argend = find_name_end(arg, NULL, NULL, FNE_INCL_BR); + arg = (char *)skip_var_list(arg, &var_count, &semicolon, true); + if (arg != NULL) { + arg = skipwhite(arg); } - arg = skipwhite(argend); - if (arg[0] == '=' && arg[1] == '<' && arg[2] == '<') { + if (arg != NULL && strncmp(arg, "=<<", 3) == 0) { p = skipwhite(arg + 3); while (true) { if (strncmp(p, "trim", 4) == 0) { diff --git a/src/nvim/input.c b/src/nvim/input.c index 7667c49452..e14bfe7539 100644 --- a/src/nvim/input.c +++ b/src/nvim/input.c @@ -14,6 +14,7 @@ #include "nvim/highlight_defs.h" #include "nvim/input.h" #include "nvim/keycodes.h" +#include "nvim/math.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -21,6 +22,7 @@ #include "nvim/os/input.h" #include "nvim/state_defs.h" #include "nvim/ui.h" +#include "nvim/vim_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "input.c.generated.h" // IWYU pragma: export @@ -180,10 +182,9 @@ int get_number(int colon, bool *mouse_used) ui_cursor_goto(msg_row, msg_col); int c = safe_vgetc(); if (ascii_isdigit(c)) { - if (n > INT_MAX / 10) { + if (vim_append_digit_int(&n, c - '0') == FAIL) { return 0; } - n = n * 10 + c - '0'; msg_putchar(c); typed++; } else if (c == K_DEL || c == K_KDEL || c == K_BS || c == Ctrl_H) { diff --git a/src/nvim/math.c b/src/nvim/math.c index 2fd9cd6ce7..47a667416c 100644 --- a/src/nvim/math.c +++ b/src/nvim/math.c @@ -1,14 +1,16 @@ // uncrustify:off #include <math.h> // uncrustify:on +#include <limits.h> #include <stdint.h> #include <string.h> -#ifdef _MSC_VER +#ifdef HAVE_BITSCANFORWARD64 # include <intrin.h> // Required for _BitScanForward64 #endif #include "nvim/math.h" +#include "nvim/vim_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "math.c.generated.h" @@ -74,3 +76,14 @@ int xctz(uint64_t x) return count; #endif } + +/// For overflow detection, add a digit safely to an int value. +int vim_append_digit_int(int *value, int digit) +{ + int x = *value; + if (x > ((INT_MAX - digit) / 10)) { + return FAIL; + } + *value = x * 10 + digit; + return OK; +} diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 0a7bb78102..c7a56209e4 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1387,7 +1387,7 @@ bool mb_isalpha(int a) return mb_islower(a) || mb_isupper(a); } -int utf_strnicmp(const char *s1, const char *s2, size_t n1, size_t n2) +static int utf_strnicmp(const char *s1, const char *s2, size_t n1, size_t n2) { int c1, c2; char buffer[6]; diff --git a/src/nvim/normal.c b/src/nvim/normal.c index a95965ad6a..b40a11f6d8 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -48,6 +48,7 @@ #include "nvim/mapping.h" #include "nvim/mark.h" #include "nvim/mark_defs.h" +#include "nvim/math.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memline_defs.h" @@ -2639,11 +2640,10 @@ static bool nv_z_get_count(cmdarg_T *cap, int *nchar_arg) if (nchar == K_DEL || nchar == K_KDEL) { n /= 10; } else if (ascii_isdigit(nchar)) { - if (n > INT_MAX / 10) { + if (vim_append_digit_int(&n, nchar - '0') == FAIL) { clearopbeep(cap->oap); break; } - n = n * 10 + (nchar - '0'); } else if (nchar == CAR) { win_setheight(n); break; diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 32fb086ca6..a81990670a 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -1627,9 +1627,7 @@ static void mb_decompose(int c, int *c1, int *c2, int *c3) /// Compare two strings, ignore case if rex.reg_ic set. /// Return 0 if strings match, non-zero otherwise. -/// Correct the length "*n" when composing characters are ignored -/// or for utf8 when both utf codepoints are considered equal because of -/// case-folding but have different length (e.g. 's' and 'ſ') +/// Correct the length "*n" when composing characters are ignored. static int cstrncmp(char *s1, char *s2, int *n) { int result; @@ -1637,11 +1635,8 @@ static int cstrncmp(char *s1, char *s2, int *n) if (!rex.reg_ic) { result = strncmp(s1, s2, (size_t)(*n)); } else { - int l2 = utfc_ptr2len(s2); - result = utf_strnicmp(s1, s2, (size_t)(*n), (size_t)l2); - if (result == 0 && l2 < *n) { - *n = l2; - } + assert(*n >= 0); + result = mb_strnicmp(s1, s2, (size_t)(*n)); } // if it failed and it's utf8 and we want to combineignore: @@ -6495,9 +6490,11 @@ static bool regmatch(uint8_t *scan, const proftime_T *tm, int *timed_out) } } } else { - if (cstrncmp((char *)opnd, (char *)rex.input, &len) != 0) { - status = RA_NOMATCH; - break; + for (i = 0; i < len; i++) { + if (opnd[i] != rex.input[i]) { + status = RA_NOMATCH; + break; + } } } rex.input += len; @@ -13849,25 +13846,19 @@ static int skip_to_start(int c, colnr_T *colp) static int find_match_text(colnr_T *startcol, int regstart, uint8_t *match_text) { colnr_T col = *startcol; - const int regstart_len = utf_char2len(regstart); + const int regstart_len = utf_ptr2len((char *)rex.line + col); while (true) { bool match = true; uint8_t *s1 = match_text; - // skip regstart - uint8_t *s2 = rex.line + col + regstart_len; - if (regstart_len > 1 - && utf_char2len(utf_ptr2char((char *)rex.line + col)) != regstart_len) { - // because of case-folding of the previously matched text, we may need - // to skip fewer bytes than utf_char2len(regstart) - s2 = rex.line + col + utf_char2len(utf_fold(regstart)); - } + uint8_t *s2 = rex.line + col + regstart_len; // skip regstart while (*s1) { int c1_len = utf_ptr2len((char *)s1); int c1 = utf_ptr2char((char *)s1); int c2_len = utf_ptr2len((char *)s2); int c2 = utf_ptr2char((char *)s2); - if (c1 != c2 && (!rex.reg_ic || utf_fold(c1) != utf_fold(c2))) { + if ((c1 != c2 && (!rex.reg_ic || utf_fold(c1) != utf_fold(c2))) + || c1_len != c2_len) { match = false; break; } @@ -15531,7 +15522,7 @@ static int nfa_regexec_both(uint8_t *line, colnr_T startcol, proftime_T *tm, int // If match_text is set it contains the full text that must match. // Nothing else to try. Doesn't handle combining chars well. - if (prog->match_text != NULL && *prog->match_text != NUL && !rex.reg_icombine) { + if (prog->match_text != NULL && !rex.reg_icombine) { retval = find_match_text(&col, prog->regstart, prog->match_text); if (REG_MULTI) { rex.reg_mmatch->rmm_matchcol = col; diff --git a/test/benchmark/autocmd_spec.lua b/test/benchmark/autocmd_spec.lua index 0d0d37690f..19660723e0 100644 --- a/test/benchmark/autocmd_spec.lua +++ b/test/benchmark/autocmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/benchmark/bench_regexp_spec.lua b/test/benchmark/bench_regexp_spec.lua index 9c0b86b6b5..4a2d01130a 100644 --- a/test/benchmark/bench_regexp_spec.lua +++ b/test/benchmark/bench_regexp_spec.lua @@ -1,6 +1,6 @@ -- Test for benchmarking the RE engine. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, command = t.clear, t.command diff --git a/test/benchmark/screenpos_spec.lua b/test/benchmark/screenpos_spec.lua index bd6860f313..a05c8909f5 100644 --- a/test/benchmark/screenpos_spec.lua +++ b/test/benchmark/screenpos_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api = t.api local Screen = require('test.functional.ui.screen') diff --git a/test/benchmark/treesitter_spec.lua b/test/benchmark/treesitter_spec.lua index 18b9241081..74c2e9ec8e 100644 --- a/test/benchmark/treesitter_spec.lua +++ b/test/benchmark/treesitter_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/functional/api/autocmd_spec.lua b/test/functional/api/autocmd_spec.lua index b97647850c..31276c7566 100644 --- a/test/functional/api/autocmd_spec.lua +++ b/test/functional/api/autocmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index de56c16bd8..ec5c046878 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local eq = t.eq diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index 715c469c76..494bc4495b 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq, ok = t.eq, t.ok local fn = t.fn diff --git a/test/functional/api/command_spec.lua b/test/functional/api/command_spec.lua index 29d96a1ff5..6c51fac178 100644 --- a/test/functional/api/command_spec.lua +++ b/test/functional/api/command_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local NIL = vim.NIL local clear = t.clear diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua index 1a96510d3d..82e7ad3988 100644 --- a/test/functional/api/extmark_spec.lua +++ b/test/functional/api/extmark_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local request = t.request diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 4156af5901..50e79f8860 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local Screen = require('test.functional.ui.screen') local eq, eval = t.eq, t.eval diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index d6a8b592d7..2b889fa012 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/api/menu_spec.lua b/test/functional/api/menu_spec.lua index 97d0f43d64..2e6fdd6551 100644 --- a/test/functional/api/menu_spec.lua +++ b/test/functional/api/menu_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/api/proc_spec.lua b/test/functional/api/proc_spec.lua index 85e55d0cfb..1b090aa30d 100644 --- a/test/functional/api/proc_spec.lua +++ b/test/functional/api/proc_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/api/server_notifications_spec.lua b/test/functional/api/server_notifications_spec.lua index ee2e401dd5..fd7e596016 100644 --- a/test/functional/api/server_notifications_spec.lua +++ b/test/functional/api/server_notifications_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_log = t.assert_log local eq, clear, eval, command, next_msg = t.eq, t.clear, t.eval, t.command, t.next_msg local api = t.api diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index 3a925dcbe2..5385b23ec1 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -1,6 +1,6 @@ -- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate -- `rpcrequest` calls we need the client event loop to be running. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval = t.clear, t.eval local eq, neq, run, stop = t.eq, t.neq, t.run, t.stop diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua index 6ed5daca0f..328e3aa653 100644 --- a/test/functional/api/tabpage_spec.lua +++ b/test/functional/api/tabpage_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, ok = t.clear, t.eq, t.ok local exec = t.exec local feed = t.feed diff --git a/test/functional/api/ui_spec.lua b/test/functional/api/ui_spec.lua index 89eeeaa189..36fa71f2ec 100644 --- a/test/functional/api/ui_spec.lua +++ b/test/functional/api/ui_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/api/version_spec.lua b/test/functional/api/version_spec.lua index 7ab27be298..b57f67369e 100644 --- a/test/functional/api/version_spec.lua +++ b/test/functional/api/version_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, fn, eq = t.clear, t.fn, t.eq local api = t.api diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 82d5480997..4e9a42f11d 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local uv = vim.uv diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 43f1a05414..6a99352b3c 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, curbuf, curbuf_contents, curwin, eq, neq, matches, ok, feed, insert, eval = t.clear, diff --git a/test/functional/autocmd/autocmd_oldtest_spec.lua b/test/functional/autocmd/autocmd_oldtest_spec.lua index 8b72fb57c3..e0df54e20e 100644 --- a/test/functional/autocmd/autocmd_oldtest_spec.lua +++ b/test/functional/autocmd/autocmd_oldtest_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index bee64c98b9..d5c4625b72 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_visible = t.assert_visible diff --git a/test/functional/autocmd/bufenter_spec.lua b/test/functional/autocmd/bufenter_spec.lua index ca67099eb7..7851ed5fe3 100644 --- a/test/functional/autocmd/bufenter_spec.lua +++ b/test/functional/autocmd/bufenter_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/bufmodifiedset_spec.lua b/test/functional/autocmd/bufmodifiedset_spec.lua index e10bb8be20..25d6adee21 100644 --- a/test/functional/autocmd/bufmodifiedset_spec.lua +++ b/test/functional/autocmd/bufmodifiedset_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua index 9ddeb947e3..84cd3f838f 100644 --- a/test/functional/autocmd/cmdline_spec.lua +++ b/test/functional/autocmd/cmdline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/autocmd/cursorhold_spec.lua b/test/functional/autocmd/cursorhold_spec.lua index c65d6f11d7..788630308f 100644 --- a/test/functional/autocmd/cursorhold_spec.lua +++ b/test/functional/autocmd/cursorhold_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/autocmd/cursormoved_spec.lua b/test/functional/autocmd/cursormoved_spec.lua index cd89ed416b..58436dc4e7 100644 --- a/test/functional/autocmd/cursormoved_spec.lua +++ b/test/functional/autocmd/cursormoved_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/autocmd/dirchanged_spec.lua b/test/functional/autocmd/dirchanged_spec.lua index d089a2dbdb..2634b99ea4 100644 --- a/test/functional/autocmd/dirchanged_spec.lua +++ b/test/functional/autocmd/dirchanged_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/filetype_spec.lua b/test/functional/autocmd/filetype_spec.lua index b0482b37cf..d1280e322f 100644 --- a/test/functional/autocmd/filetype_spec.lua +++ b/test/functional/autocmd/filetype_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eval = t.eval local clear = t.clear diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua index af4bcef702..acb7fed22e 100644 --- a/test/functional/autocmd/focus_spec.lua +++ b/test/functional/autocmd/focus_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear = t.clear local feed_command = t.feed_command diff --git a/test/functional/autocmd/modechanged_spec.lua b/test/functional/autocmd/modechanged_spec.lua index c6724c868f..f0321ff71d 100644 --- a/test/functional/autocmd/modechanged_spec.lua +++ b/test/functional/autocmd/modechanged_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval, eq = t.clear, t.eval, t.eq local feed, command = t.feed, t.command local exec_lua = t.exec_lua diff --git a/test/functional/autocmd/recording_spec.lua b/test/functional/autocmd/recording_spec.lua index c2d5ac0852..f6ef1c56c5 100644 --- a/test/functional/autocmd/recording_spec.lua +++ b/test/functional/autocmd/recording_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/autocmd/safestate_spec.lua b/test/functional/autocmd/safestate_spec.lua index 8c2e7a78a0..746a1aeb98 100644 --- a/test/functional/autocmd/safestate_spec.lua +++ b/test/functional/autocmd/safestate_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local exec = t.exec diff --git a/test/functional/autocmd/searchwrapped_spec.lua b/test/functional/autocmd/searchwrapped_spec.lua index e9fd1f400c..bcb8fef046 100644 --- a/test/functional/autocmd/searchwrapped_spec.lua +++ b/test/functional/autocmd/searchwrapped_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/show_spec.lua b/test/functional/autocmd/show_spec.lua index cc9eec8361..cb3e655029 100644 --- a/test/functional/autocmd/show_spec.lua +++ b/test/functional/autocmd/show_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/autocmd/signal_spec.lua b/test/functional/autocmd/signal_spec.lua index 8c95b065fa..8ff7ee9e0f 100644 --- a/test/functional/autocmd/signal_spec.lua +++ b/test/functional/autocmd/signal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/tabclose_spec.lua b/test/functional/autocmd/tabclose_spec.lua index 7a8c588c10..c29fb08642 100644 --- a/test/functional/autocmd/tabclose_spec.lua +++ b/test/functional/autocmd/tabclose_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq = t.clear, t.eq local api = t.api local command = t.command diff --git a/test/functional/autocmd/tabnew_spec.lua b/test/functional/autocmd/tabnew_spec.lua index be7f4318fe..314b27bdba 100644 --- a/test/functional/autocmd/tabnew_spec.lua +++ b/test/functional/autocmd/tabnew_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/tabnewentered_spec.lua b/test/functional/autocmd/tabnewentered_spec.lua index 52f8eb8706..fa3c2cf658 100644 --- a/test/functional/autocmd/tabnewentered_spec.lua +++ b/test/functional/autocmd/tabnewentered_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/autocmd/termxx_spec.lua b/test/functional/autocmd/termxx_spec.lua index 99af3aed3e..88850cea52 100644 --- a/test/functional/autocmd/termxx_spec.lua +++ b/test/functional/autocmd/termxx_spec.lua @@ -1,5 +1,5 @@ local uv = vim.uv -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear, command, testprg = t.clear, t.command, t.testprg diff --git a/test/functional/autocmd/textchanged_spec.lua b/test/functional/autocmd/textchanged_spec.lua index b964b9c7cd..1991632cca 100644 --- a/test/functional/autocmd/textchanged_spec.lua +++ b/test/functional/autocmd/textchanged_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec = t.exec local command = t.command diff --git a/test/functional/autocmd/textyankpost_spec.lua b/test/functional/autocmd/textyankpost_spec.lua index 45b1510b2e..9c77874652 100644 --- a/test/functional/autocmd/textyankpost_spec.lua +++ b/test/functional/autocmd/textyankpost_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval, eq = t.clear, t.eval, t.eq local feed, command, expect = t.feed, t.command, t.expect local api, fn, neq = t.api, t.fn, t.neq diff --git a/test/functional/autocmd/win_scrolled_resized_spec.lua b/test/functional/autocmd/win_scrolled_resized_spec.lua index 9405c083ff..467f80d67f 100644 --- a/test/functional/autocmd/win_scrolled_resized_spec.lua +++ b/test/functional/autocmd/win_scrolled_resized_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua index 24a295093a..84a7bf6ddc 100644 --- a/test/functional/core/channels_spec.lua +++ b/test/functional/core/channels_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, eval, next_msg, ok, source = t.clear, t.eq, t.eval, t.next_msg, t.ok, t.source local command, fn, api = t.command, t.fn, t.api local matches = t.matches diff --git a/test/functional/core/exit_spec.lua b/test/functional/core/exit_spec.lua index 058d67dba1..0e7ddf8bd1 100644 --- a/test/functional/core/exit_spec.lua +++ b/test/functional/core/exit_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local command = t.command diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index 4b1018b0f0..04d745a6c3 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -1,5 +1,5 @@ local uv = vim.uv -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_log = t.assert_log local assert_nolog = t.assert_nolog diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 17264d80a5..f8144e9c05 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear = t.clear diff --git a/test/functional/core/log_spec.lua b/test/functional/core/log_spec.lua index dfacc0af6e..dd08d81342 100644 --- a/test/functional/core/log_spec.lua +++ b/test/functional/core/log_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_log = t.assert_log local clear = t.clear local command = t.command diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua index ee3e32d794..a318fdec3c 100644 --- a/test/functional/core/main_spec.lua +++ b/test/functional/core/main_spec.lua @@ -1,5 +1,5 @@ local uv = vim.uv -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/core/path_spec.lua b/test/functional/core/path_spec.lua index 65eaa201d9..92fcde978b 100644 --- a/test/functional/core/path_spec.lua +++ b/test/functional/core/path_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/core/remote_spec.lua b/test/functional/core/remote_spec.lua index 5c8a86091d..0b110a3538 100644 --- a/test/functional/core/remote_spec.lua +++ b/test/functional/core/remote_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/core/spellfile_spec.lua b/test/functional/core/spellfile_spec.lua index ac3f1b27a6..814df522cf 100644 --- a/test/functional/core/spellfile_spec.lua +++ b/test/functional/core/spellfile_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 31e4805d76..e98b1bdd87 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive diff --git a/test/functional/editor/K_spec.lua b/test/functional/editor/K_spec.lua index 9feb878378..91038e5f4e 100644 --- a/test/functional/editor/K_spec.lua +++ b/test/functional/editor/K_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, clear, eval, feed, api, retry = t.eq, t.clear, t.eval, t.feed, t.api, t.retry describe('K', function() diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index 45cfb062ad..c479a9ccf1 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive local clear, feed = t.clear, t.feed diff --git a/test/functional/editor/count_spec.lua b/test/functional/editor/count_spec.lua index 808460520b..6a3efcf515 100644 --- a/test/functional/editor/count_spec.lua +++ b/test/functional/editor/count_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval diff --git a/test/functional/editor/ctrl_c_spec.lua b/test/functional/editor/ctrl_c_spec.lua index ff12f5db0d..b0160630d9 100644 --- a/test/functional/editor/ctrl_c_spec.lua +++ b/test/functional/editor/ctrl_c_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, source = t.clear, t.feed, t.source local command = t.command diff --git a/test/functional/editor/fold_spec.lua b/test/functional/editor/fold_spec.lua index e0c986f55f..336b97b15e 100644 --- a/test/functional/editor/fold_spec.lua +++ b/test/functional/editor/fold_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local insert = t.insert diff --git a/test/functional/editor/jump_spec.lua b/test/functional/editor/jump_spec.lua index ad064091d8..5911fcdbfb 100644 --- a/test/functional/editor/jump_spec.lua +++ b/test/functional/editor/jump_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/editor/lang_spec.lua b/test/functional/editor/lang_spec.lua index b7154a27f8..0e11a53999 100644 --- a/test/functional/editor/lang_spec.lua +++ b/test/functional/editor/lang_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, insert, eq = t.clear, t.insert, t.eq local command, expect = t.command, t.expect local feed, eval = t.feed, t.eval diff --git a/test/functional/editor/langmap_spec.lua b/test/functional/editor/langmap_spec.lua index b569b70925..a17bbc4f16 100644 --- a/test/functional/editor/langmap_spec.lua +++ b/test/functional/editor/langmap_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, neq, call = t.eq, t.neq, t.call local eval, feed, clear = t.eval, t.feed, t.clear diff --git a/test/functional/editor/macro_spec.lua b/test/functional/editor/macro_spec.lua index 86e7b8f3c8..a2a165ab0f 100644 --- a/test/functional/editor/macro_spec.lua +++ b/test/functional/editor/macro_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval @@ -10,10 +10,11 @@ local fn = t.fn local api = t.api local insert = t.insert -describe('macros', function() +describe('macros with default mappings', function() before_each(function() clear({ args_rm = { '--cmd' } }) end) + it('can be recorded and replayed', function() feed('qiahello<esc>q') expect('hello') @@ -22,6 +23,7 @@ describe('macros', function() expect('hellohello') eq('ahello', eval('@i')) end) + it('applies maps', function() command('imap x l') command('nmap l a') @@ -34,87 +36,184 @@ describe('macros', function() end) it('can be replayed with Q', function() - insert [[hello + insert [[ +hello hello hello]] feed [[gg]] feed [[qqAFOO<esc>q]] - eq({ 'helloFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOO +hello +hello]] feed [[Q]] - eq({ 'helloFOOFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOOFOO +hello +hello]] feed [[G3Q]] - eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOOFOO +hello +helloFOOFOOFOO]] feed [[ggV3jQ]] - eq( - { 'helloFOOFOOFOO', 'helloFOO', 'helloFOOFOOFOOFOO' }, - api.nvim_buf_get_lines(0, 0, -1, false) - ) + expect [[ +helloFOOFOOFOO +helloFOO +helloFOOFOOFOOFOO]] end) - it('can be replayed with @', function() - insert [[hello + it('can be replayed with Q and @@', function() + insert [[ +hello hello hello]] feed [[gg]] feed [[qqAFOO<esc>q]] - eq({ 'helloFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOO +hello +hello]] feed [[Q]] - eq({ 'helloFOOFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOOFOO +hello +hello]] feed [[G3@@]] - eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOOFOO +hello +helloFOOFOOFOO]] feed [[ggV2j@@]] - eq( - { 'helloFOOFOOFOO', 'helloFOO', 'helloFOOFOOFOOFOO' }, - api.nvim_buf_get_lines(0, 0, -1, false) - ) + expect [[ +helloFOOFOOFOO +helloFOO +helloFOOFOOFOOFOO]] end) - it('can be replayed with @q and @w', function() - insert [[hello + it('can be replayed with @ in linewise Visual mode', function() + insert [[ +hello hello hello]] feed [[gg]] feed [[qqAFOO<esc>qu]] - eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +hello +hello +hello]] feed [[qwA123<esc>qu]] - eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +hello +hello +hello]] feed [[V3j@q]] - eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOO +helloFOO +helloFOO]] - feed [[gg]] - feed [[Vj@w]] - eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + feed [[ggVj@w]] + expect [[ +helloFOO123 +helloFOO123 +helloFOO]] end) - it('can be replayed with @q and @w visual-block', function() - insert [[hello + -- XXX: does this really make sense? + it('can be replayed with @ in blockwise Visual mode', function() + insert [[ +hello hello hello]] feed [[gg]] feed [[qqAFOO<esc>qu]] - eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +hello +hello +hello]] feed [[qwA123<esc>qu]] - eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +hello +hello +hello]] feed [[<C-v>3j@q]] - eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + expect [[ +helloFOO +helloFOO +helloFOO]] + feed [[gg<C-v>j@w]] + expect [[ +helloFOO123 +helloFOO123 +helloFOO]] + end) +end) + +describe('macros without default mappings', function() + before_each(clear) + + it('can be recorded and replayed in Visual mode', function() + insert('foo BAR BAR foo BAR foo BAR BAR BAR foo BAR BAR') + feed('0vqifofRq') + eq({ 0, 1, 7, 0 }, fn.getpos('.')) + eq({ 0, 1, 1, 0 }, fn.getpos('v')) + feed('Q') + eq({ 0, 1, 19, 0 }, fn.getpos('.')) + eq({ 0, 1, 1, 0 }, fn.getpos('v')) + feed('Q') + eq({ 0, 1, 27, 0 }, fn.getpos('.')) + eq({ 0, 1, 1, 0 }, fn.getpos('v')) + feed('@i') + eq({ 0, 1, 43, 0 }, fn.getpos('.')) + eq({ 0, 1, 1, 0 }, fn.getpos('v')) + end) + + it('can be replayed with @ in blockwise Visual mode', function() + insert [[ +hello +hello +hello]] feed [[gg]] - feed [[<C-v>j@w]] - eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false)) + + feed [[qqAFOO<esc>qu]] + expect [[ +hello +hello +hello]] + + feed [[qwA123<esc>qu]] + expect [[ +hello +hello +hello]] + + feed [[0<C-v>3jl@q]] + expect [[ +heFOOllo +heFOOllo +heFOOllo]] + + feed [[gg0<C-v>j@w]] + expect [[ +h123eFOOllo +h123eFOOllo +heFOOllo]] end) end) diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua index ad45edd500..dfbf1e3e58 100644 --- a/test/functional/editor/mark_spec.lua +++ b/test/functional/editor/mark_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local api = t.api local clear = t.clear diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua index 97acb3d090..0dc6884fac 100644 --- a/test/functional/editor/meta_key_spec.lua +++ b/test/functional/editor/meta_key_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local command = t.command local exec_lua = t.exec_lua diff --git a/test/functional/editor/mode_cmdline_spec.lua b/test/functional/editor/mode_cmdline_spec.lua index 6347c0f063..e52eb7aaba 100644 --- a/test/functional/editor/mode_cmdline_spec.lua +++ b/test/functional/editor/mode_cmdline_spec.lua @@ -1,6 +1,6 @@ -- Cmdline-mode tests. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, insert, fn, eq, feed = t.clear, t.insert, t.fn, t.eq, t.feed local eval = t.eval diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua index 1323260257..aad92cb36a 100644 --- a/test/functional/editor/mode_insert_spec.lua +++ b/test/functional/editor/mode_insert_spec.lua @@ -1,6 +1,6 @@ -- Insert-mode tests. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, insert = t.clear, t.feed, t.insert local expect = t.expect diff --git a/test/functional/editor/mode_normal_spec.lua b/test/functional/editor/mode_normal_spec.lua index fcc13782e5..8790cbe8a8 100644 --- a/test/functional/editor/mode_normal_spec.lua +++ b/test/functional/editor/mode_normal_spec.lua @@ -1,6 +1,6 @@ -- Normal mode tests. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local feed = t.feed local fn = t.fn diff --git a/test/functional/editor/put_spec.lua b/test/functional/editor/put_spec.lua index 96a1d87b8b..85580498b7 100644 --- a/test/functional/editor/put_spec.lua +++ b/test/functional/editor/put_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local insert = t.insert diff --git a/test/functional/editor/search_spec.lua b/test/functional/editor/search_spec.lua index 2ccbcc8865..c8c7c688f6 100644 --- a/test/functional/editor/search_spec.lua +++ b/test/functional/editor/search_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua index e77e30f9e0..4b880e21bf 100644 --- a/test/functional/editor/tabpage_spec.lua +++ b/test/functional/editor/tabpage_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/editor/undo_spec.lua b/test/functional/editor/undo_spec.lua index f6dd07054b..70ed5b6756 100644 --- a/test/functional/editor/undo_spec.lua +++ b/test/functional/editor/undo_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/ex_cmds/append_spec.lua b/test/functional/ex_cmds/append_spec.lua index 5069568b98..4d50bfb5a1 100644 --- a/test/functional/ex_cmds/append_spec.lua +++ b/test/functional/ex_cmds/append_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local dedent = t.dedent diff --git a/test/functional/ex_cmds/arg_spec.lua b/test/functional/ex_cmds/arg_spec.lua index 3c12c535dd..71a2f4ed77 100644 --- a/test/functional/ex_cmds/arg_spec.lua +++ b/test/functional/ex_cmds/arg_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, command, fn = t.eq, t.command, t.fn local ok = t.ok local matches = t.matches diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua index 40c9172010..7568d6c935 100644 --- a/test/functional/ex_cmds/cd_spec.lua +++ b/test/functional/ex_cmds/cd_spec.lua @@ -1,6 +1,6 @@ -- Specs for :cd, :tcd, :lcd and getcwd() -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local call = t.call diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua index 83a2c661b0..e77d213ea3 100644 --- a/test/functional/ex_cmds/cmd_map_spec.lua +++ b/test/functional/ex_cmds/cmd_map_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local feed = t.feed local eq = t.eq diff --git a/test/functional/ex_cmds/debug_spec.lua b/test/functional/ex_cmds/debug_spec.lua index 7614cf5c7f..b0da98a87d 100644 --- a/test/functional/ex_cmds/debug_spec.lua +++ b/test/functional/ex_cmds/debug_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed local clear = t.clear diff --git a/test/functional/ex_cmds/dict_notifications_spec.lua b/test/functional/ex_cmds/dict_notifications_spec.lua index 6ebc292402..23aeb4ee9d 100644 --- a/test/functional/ex_cmds/dict_notifications_spec.lua +++ b/test/functional/ex_cmds/dict_notifications_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local clear, source = t.clear, t.source local api = t.api diff --git a/test/functional/ex_cmds/digraphs_spec.lua b/test/functional/ex_cmds/digraphs_spec.lua index ac33409a35..ec83db9a84 100644 --- a/test/functional/ex_cmds/digraphs_spec.lua +++ b/test/functional/ex_cmds/digraphs_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local feed = t.feed diff --git a/test/functional/ex_cmds/drop_spec.lua b/test/functional/ex_cmds/drop_spec.lua index ad813d13d3..6b875270c8 100644 --- a/test/functional/ex_cmds/drop_spec.lua +++ b/test/functional/ex_cmds/drop_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command = t.command local Screen = require('test.functional.ui.screen') local clear, feed, feed_command = t.clear, t.feed, t.feed_command diff --git a/test/functional/ex_cmds/echo_spec.lua b/test/functional/ex_cmds/echo_spec.lua index 69b16be788..3b523d2c98 100644 --- a/test/functional/ex_cmds/echo_spec.lua +++ b/test/functional/ex_cmds/echo_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local NIL = vim.NIL diff --git a/test/functional/ex_cmds/edit_spec.lua b/test/functional/ex_cmds/edit_spec.lua index 1ae34abad2..c51b860aeb 100644 --- a/test/functional/ex_cmds/edit_spec.lua +++ b/test/functional/ex_cmds/edit_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, command, fn = t.eq, t.command, t.fn local ok = t.ok local matches = t.matches diff --git a/test/functional/ex_cmds/encoding_spec.lua b/test/functional/ex_cmds/encoding_spec.lua index 7f46d103aa..520ed6fff6 100644 --- a/test/functional/ex_cmds/encoding_spec.lua +++ b/test/functional/ex_cmds/encoding_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed_command, feed = t.clear, t.feed_command, t.feed local eq, neq, eval = t.eq, t.neq, t.eval diff --git a/test/functional/ex_cmds/excmd_spec.lua b/test/functional/ex_cmds/excmd_spec.lua index 70767615b3..cb277263c7 100644 --- a/test/functional/ex_cmds/excmd_spec.lua +++ b/test/functional/ex_cmds/excmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command = t.command local eq = t.eq local clear = t.clear diff --git a/test/functional/ex_cmds/file_spec.lua b/test/functional/ex_cmds/file_spec.lua index a4c2fb5472..654d96cb77 100644 --- a/test/functional/ex_cmds/file_spec.lua +++ b/test/functional/ex_cmds/file_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/ex_cmds/grep_spec.lua b/test/functional/ex_cmds/grep_spec.lua index 91007b3095..328064ed3c 100644 --- a/test/functional/ex_cmds/grep_spec.lua +++ b/test/functional/ex_cmds/grep_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed_command, feed, ok, eval = t.clear, t.feed_command, t.feed, t.ok, t.eval describe(':grep', function() diff --git a/test/functional/ex_cmds/help_spec.lua b/test/functional/ex_cmds/help_spec.lua index b8f8ee95ec..9a86b2b345 100644 --- a/test/functional/ex_cmds/help_spec.lua +++ b/test/functional/ex_cmds/help_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/ex_cmds/highlight_spec.lua b/test/functional/ex_cmds/highlight_spec.lua index 77ae4d1dfb..a34e9c1659 100644 --- a/test/functional/ex_cmds/highlight_spec.lua +++ b/test/functional/ex_cmds/highlight_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, command = t.eq, t.command local clear = t.clear local eval, exc_exec = t.eval, t.exc_exec diff --git a/test/functional/ex_cmds/ls_spec.lua b/test/functional/ex_cmds/ls_spec.lua index 43b72ce69e..e8c61a0c59 100644 --- a/test/functional/ex_cmds/ls_spec.lua +++ b/test/functional/ex_cmds/ls_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/ex_cmds/make_spec.lua b/test/functional/ex_cmds/make_spec.lua index 22b7c6a217..dc991dfc09 100644 --- a/test/functional/ex_cmds/make_spec.lua +++ b/test/functional/ex_cmds/make_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eval = t.eval local has_powershell = t.has_powershell diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua index 758b055a89..4a20ff939c 100644 --- a/test/functional/ex_cmds/map_spec.lua +++ b/test/functional/ex_cmds/map_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 1e243dabab..2834338a1a 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command = t.clear, t.command local expect, feed = t.expect, t.feed local eq, eval = t.eq, t.eval diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua index a7d62e5493..aeb0e5b3b0 100644 --- a/test/functional/ex_cmds/mksession_spec.lua +++ b/test/functional/ex_cmds/mksession_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/ex_cmds/mkview_spec.lua b/test/functional/ex_cmds/mkview_spec.lua index 1658d96229..5dcf866490 100644 --- a/test/functional/ex_cmds/mkview_spec.lua +++ b/test/functional/ex_cmds/mkview_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/ex_cmds/normal_spec.lua b/test/functional/ex_cmds/normal_spec.lua index 943b994f62..0fb7635b9c 100644 --- a/test/functional/ex_cmds/normal_spec.lua +++ b/test/functional/ex_cmds/normal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local fn = t.fn diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua index 357fc3bcfb..f0e6a5f53a 100644 --- a/test/functional/ex_cmds/oldfiles_spec.lua +++ b/test/functional/ex_cmds/oldfiles_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/ex_cmds/print_commands_spec.lua b/test/functional/ex_cmds/print_commands_spec.lua index 8ec8b5c86d..cb94bf73de 100644 --- a/test/functional/ex_cmds/print_commands_spec.lua +++ b/test/functional/ex_cmds/print_commands_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, command, fn = t.clear, t.eq, t.command, t.fn describe(':z^', function() diff --git a/test/functional/ex_cmds/profile_spec.lua b/test/functional/ex_cmds/profile_spec.lua index 38bb7988ee..9dc95dbb91 100644 --- a/test/functional/ex_cmds/profile_spec.lua +++ b/test/functional/ex_cmds/profile_spec.lua @@ -1,7 +1,7 @@ require('os') local uv = vim.uv -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eval = t.eval local command = t.command local eq, neq = t.eq, t.neq diff --git a/test/functional/ex_cmds/quickfix_commands_spec.lua b/test/functional/ex_cmds/quickfix_commands_spec.lua index 7e724dd1dd..072d378875 100644 --- a/test/functional/ex_cmds/quickfix_commands_spec.lua +++ b/test/functional/ex_cmds/quickfix_commands_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed diff --git a/test/functional/ex_cmds/quit_spec.lua b/test/functional/ex_cmds/quit_spec.lua index 4cc15cc378..14efc9ef72 100644 --- a/test/functional/ex_cmds/quit_spec.lua +++ b/test/functional/ex_cmds/quit_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear describe(':qa', function() diff --git a/test/functional/ex_cmds/script_spec.lua b/test/functional/ex_cmds/script_spec.lua index 966e06d705..2b9f3bd353 100644 --- a/test/functional/ex_cmds/script_spec.lua +++ b/test/functional/ex_cmds/script_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local neq = t.neq diff --git a/test/functional/ex_cmds/sign_spec.lua b/test/functional/ex_cmds/sign_spec.lua index 8954f6e5d6..a96873a0b0 100644 --- a/test/functional/ex_cmds/sign_spec.lua +++ b/test/functional/ex_cmds/sign_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, assert_alive = t.clear, t.eq, t.assert_alive local command = t.command local api = t.api diff --git a/test/functional/ex_cmds/source_spec.lua b/test/functional/ex_cmds/source_spec.lua index d8aa4f2747..99fb66cbfb 100644 --- a/test/functional/ex_cmds/source_spec.lua +++ b/test/functional/ex_cmds/source_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command = t.command local insert = t.insert local eq = t.eq diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua index fc2e1eda82..2986b8c62f 100644 --- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua +++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local uv = vim.uv local eq, eval, expect, exec = t.eq, t.eval, t.expect, t.exec local assert_alive = t.assert_alive diff --git a/test/functional/ex_cmds/syntax_spec.lua b/test/functional/ex_cmds/syntax_spec.lua index f8662e7d07..879983dc53 100644 --- a/test/functional/ex_cmds/syntax_spec.lua +++ b/test/functional/ex_cmds/syntax_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/ex_cmds/trust_spec.lua b/test/functional/ex_cmds/trust_spec.lua index 7c84d1d04b..6b3ab9ff25 100644 --- a/test/functional/ex_cmds/trust_spec.lua +++ b/test/functional/ex_cmds/trust_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/ex_cmds/undojoin_spec.lua b/test/functional/ex_cmds/undojoin_spec.lua index 4ba530562e..90e18f6a4b 100644 --- a/test/functional/ex_cmds/undojoin_spec.lua +++ b/test/functional/ex_cmds/undojoin_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/ex_cmds/verbose_spec.lua b/test/functional/ex_cmds/verbose_spec.lua index 9ec0ee02ae..047edfba76 100644 --- a/test/functional/ex_cmds/verbose_spec.lua +++ b/test/functional/ex_cmds/verbose_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/ex_cmds/wincmd_spec.lua b/test/functional/ex_cmds/wincmd_spec.lua index 2f302daeeb..b4e04b1884 100644 --- a/test/functional/ex_cmds/wincmd_spec.lua +++ b/test/functional/ex_cmds/wincmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local fn = t.fn diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua index dd829863b1..dda4223a2a 100644 --- a/test/functional/ex_cmds/write_spec.lua +++ b/test/functional/ex_cmds/write_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, eval, clear, write_file, source, insert = t.eq, t.eval, t.clear, t.write_file, t.source, t.insert local pcall_err = t.pcall_err diff --git a/test/functional/ex_cmds/wundo_spec.lua b/test/functional/ex_cmds/wundo_spec.lua index c926ab98e5..03621205d7 100644 --- a/test/functional/ex_cmds/wundo_spec.lua +++ b/test/functional/ex_cmds/wundo_spec.lua @@ -1,6 +1,6 @@ -- Specs for :wundo and underlying functions -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command, clear, eval, spawn, nvim_prog, set_session = t.command, t.clear, t.eval, t.spawn, t.nvim_prog, t.set_session diff --git a/test/functional/ex_cmds/wviminfo_spec.lua b/test/functional/ex_cmds/wviminfo_spec.lua index f44e8f2408..f704239c57 100644 --- a/test/functional/ex_cmds/wviminfo_spec.lua +++ b/test/functional/ex_cmds/wviminfo_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command, eq, neq, write_file = t.command, t.eq, t.neq, t.write_file local read_file = t.read_file diff --git a/test/functional/example_spec.lua b/test/functional/example_spec.lua index ddc55155bf..a424d6a1fe 100644 --- a/test/functional/example_spec.lua +++ b/test/functional/example_spec.lua @@ -1,7 +1,7 @@ -- To run this test: -- TEST_FILE=test/functional/example_spec.lua make functionaltest -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/002_filename_recognition_spec.lua b/test/functional/legacy/002_filename_recognition_spec.lua index fb6dbbdc0b..c29e5febcf 100644 --- a/test/functional/legacy/002_filename_recognition_spec.lua +++ b/test/functional/legacy/002_filename_recognition_spec.lua @@ -1,7 +1,7 @@ -- Test if URLs are recognized as filenames by commands such as "gf". Here -- we'll use `expand("<cfile>")` since "gf" would need to open the file. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/004_bufenter_with_modelines_spec.lua b/test/functional/legacy/004_bufenter_with_modelines_spec.lua index 1ae5c02aca..0ba6df5afc 100644 --- a/test/functional/legacy/004_bufenter_with_modelines_spec.lua +++ b/test/functional/legacy/004_bufenter_with_modelines_spec.lua @@ -1,7 +1,7 @@ -- Test for autocommand that changes current buffer on BufEnter event. -- Check if modelines are interpreted for the correct buffer. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua index 2e833a9fb3..6da7c05244 100644 --- a/test/functional/legacy/005_bufleave_delete_buffer_spec.lua +++ b/test/functional/legacy/005_bufleave_delete_buffer_spec.lua @@ -1,7 +1,7 @@ -- Test for autocommand that deletes the current buffer on BufLeave event. -- Also test deleting the last buffer, should give a new, empty buffer. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local command, expect = t.command, t.expect local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/007_ball_buffer_list_spec.lua b/test/functional/legacy/007_ball_buffer_list_spec.lua index 60578e6aaf..3b094583ac 100644 --- a/test/functional/legacy/007_ball_buffer_list_spec.lua +++ b/test/functional/legacy/007_ball_buffer_list_spec.lua @@ -1,6 +1,6 @@ -- Test for autocommand that changes the buffer list, when doing ":ball". -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/008_autocommands_spec.lua b/test/functional/legacy/008_autocommands_spec.lua index ad68b78f4d..8978508fd7 100644 --- a/test/functional/legacy/008_autocommands_spec.lua +++ b/test/functional/legacy/008_autocommands_spec.lua @@ -1,7 +1,7 @@ -- Test for BufWritePre autocommand that deletes or unloads the buffer. -- Test for BufUnload autocommand that unloads all other buffers. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local source = t.source local clear, command, expect, eq, eval = t.clear, t.command, t.expect, t.eq, t.eval local write_file, dedent = t.write_file, t.dedent diff --git a/test/functional/legacy/011_autocommands_spec.lua b/test/functional/legacy/011_autocommands_spec.lua index 13531410cf..4ac495cec4 100644 --- a/test/functional/legacy/011_autocommands_spec.lua +++ b/test/functional/legacy/011_autocommands_spec.lua @@ -12,7 +12,7 @@ -- Use a FileChangedShell autocommand to avoid a prompt for "Xtestfile.gz" -- being modified outside of Vim (noticed on Solaris). -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed_command, expect, eq, neq, dedent, write_file, feed = t.clear, t.feed_command, t.expect, t.eq, t.neq, t.dedent, t.write_file, t.feed local command = t.command diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua index 204ccec55c..ef3d77e8d2 100644 --- a/test/functional/legacy/012_directory_spec.lua +++ b/test/functional/legacy/012_directory_spec.lua @@ -3,7 +3,7 @@ -- - "./dir", in directory relative to file -- - "dir", in directory relative to current dir -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local neq = t.neq diff --git a/test/functional/legacy/015_alignment_spec.lua b/test/functional/legacy/015_alignment_spec.lua index 7acba51c59..df4e2cdf9c 100644 --- a/test/functional/legacy/015_alignment_spec.lua +++ b/test/functional/legacy/015_alignment_spec.lua @@ -2,7 +2,7 @@ -- Also test formatting a paragraph. -- Also test undo after ":%s" and formatting. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/018_unset_smart_indenting_spec.lua b/test/functional/legacy/018_unset_smart_indenting_spec.lua index b4745f0937..50b45418ce 100644 --- a/test/functional/legacy/018_unset_smart_indenting_spec.lua +++ b/test/functional/legacy/018_unset_smart_indenting_spec.lua @@ -1,6 +1,6 @@ -- Tests for not doing smart indenting when it isn't set. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear = t.clear diff --git a/test/functional/legacy/019_smarttab_expandtab_spec.lua b/test/functional/legacy/019_smarttab_expandtab_spec.lua index 8898ba391f..e7c16207d4 100644 --- a/test/functional/legacy/019_smarttab_expandtab_spec.lua +++ b/test/functional/legacy/019_smarttab_expandtab_spec.lua @@ -1,7 +1,7 @@ -- Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. -- Also test that dv_ works correctly -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/020_blockwise_visual_spec.lua b/test/functional/legacy/020_blockwise_visual_spec.lua index 1797cc6077..eb2ad56dbc 100644 --- a/test/functional/legacy/020_blockwise_visual_spec.lua +++ b/test/functional/legacy/020_blockwise_visual_spec.lua @@ -2,7 +2,7 @@ -- First test for undo working properly when executing commands from a register. -- Also test this in an empty buffer. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/021_control_wi_spec.lua b/test/functional/legacy/021_control_wi_spec.lua index a7e0ff29d2..b0d7a654f3 100644 --- a/test/functional/legacy/021_control_wi_spec.lua +++ b/test/functional/legacy/021_control_wi_spec.lua @@ -1,6 +1,6 @@ -- Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/023_edit_arguments_spec.lua b/test/functional/legacy/023_edit_arguments_spec.lua index b354d5cfa4..14037db82d 100644 --- a/test/functional/legacy/023_edit_arguments_spec.lua +++ b/test/functional/legacy/023_edit_arguments_spec.lua @@ -1,6 +1,6 @@ -- Tests for complicated + argument to :edit command -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, insert = t.clear, t.insert local command, expect = t.command, t.expect local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/025_jump_tag_hidden_spec.lua b/test/functional/legacy/025_jump_tag_hidden_spec.lua index fe965c77d5..e4e1994fe9 100644 --- a/test/functional/legacy/025_jump_tag_hidden_spec.lua +++ b/test/functional/legacy/025_jump_tag_hidden_spec.lua @@ -1,7 +1,7 @@ -- Test for jumping to a tag with 'hidden' set, with symbolic link in path of tag. -- This only works for Unix, because of the symbolic link. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/026_execute_while_if_spec.lua b/test/functional/legacy/026_execute_while_if_spec.lua index d208c30270..721036b1df 100644 --- a/test/functional/legacy/026_execute_while_if_spec.lua +++ b/test/functional/legacy/026_execute_while_if_spec.lua @@ -1,6 +1,6 @@ -- Test for :execute, :while and :if -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local expect = t.expect diff --git a/test/functional/legacy/028_source_ctrl_v_spec.lua b/test/functional/legacy/028_source_ctrl_v_spec.lua index 903ff44b7d..704ba6bd2e 100644 --- a/test/functional/legacy/028_source_ctrl_v_spec.lua +++ b/test/functional/legacy/028_source_ctrl_v_spec.lua @@ -1,6 +1,6 @@ -- Test for sourcing a file with CTRL-V's at the end of the line -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/029_join_spec.lua b/test/functional/legacy/029_join_spec.lua index c3ca29170f..a0eb9c0f13 100644 --- a/test/functional/legacy/029_join_spec.lua +++ b/test/functional/legacy/029_join_spec.lua @@ -1,6 +1,6 @@ -- Test for joining lines with marks in them (and with 'joinspaces' set/reset) -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear = t.clear diff --git a/test/functional/legacy/030_fileformats_spec.lua b/test/functional/legacy/030_fileformats_spec.lua index 8edcd2a7f9..0053d053db 100644 --- a/test/functional/legacy/030_fileformats_spec.lua +++ b/test/functional/legacy/030_fileformats_spec.lua @@ -1,6 +1,6 @@ -- Test for a lot of variations of the 'fileformats' option -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, clear, command = t.feed, t.clear, t.command local eq, write_file = t.eq, t.write_file local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua index f9d45c7788..65abb57e42 100644 --- a/test/functional/legacy/031_close_commands_spec.lua +++ b/test/functional/legacy/031_close_commands_spec.lua @@ -9,7 +9,7 @@ -- :buf -- :edit -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear = t.clear diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua index e2f6e2ee8f..3c6da9d456 100644 --- a/test/functional/legacy/033_lisp_indent_spec.lua +++ b/test/functional/legacy/033_lisp_indent_spec.lua @@ -1,7 +1,7 @@ -- Test for 'lisp' -- If the lisp feature is not enabled, this will fail! -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local command, expect = t.command, t.expect local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/034_user_function_spec.lua b/test/functional/legacy/034_user_function_spec.lua index b93bd45068..d592bd8b8a 100644 --- a/test/functional/legacy/034_user_function_spec.lua +++ b/test/functional/legacy/034_user_function_spec.lua @@ -3,7 +3,7 @@ -- Also test that a builtin function cannot be replaced. -- Also test for regression when calling arbitrary expression. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, source = t.feed, t.insert, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/035_increment_and_decrement_spec.lua b/test/functional/legacy/035_increment_and_decrement_spec.lua index 8d2564cb6e..d3eb8d6174 100644 --- a/test/functional/legacy/035_increment_and_decrement_spec.lua +++ b/test/functional/legacy/035_increment_and_decrement_spec.lua @@ -1,7 +1,7 @@ -- Test Ctrl-A and Ctrl-X, which increment and decrement decimal, hexadecimal, -- and octal numbers. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/036_regexp_character_classes_spec.lua b/test/functional/legacy/036_regexp_character_classes_spec.lua index 4fb902440d..f948abefb7 100644 --- a/test/functional/legacy/036_regexp_character_classes_spec.lua +++ b/test/functional/legacy/036_regexp_character_classes_spec.lua @@ -1,6 +1,6 @@ -- Test character classes in regexp using regexpengine 0, 1, 2. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command, expect = t.clear, t.command, t.expect local source, write_file = t.source, t.write_file diff --git a/test/functional/legacy/038_virtual_replace_spec.lua b/test/functional/legacy/038_virtual_replace_spec.lua index abc6c03234..952b90fb6d 100644 --- a/test/functional/legacy/038_virtual_replace_spec.lua +++ b/test/functional/legacy/038_virtual_replace_spec.lua @@ -1,6 +1,6 @@ -- Test Virtual replace mode. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/039_visual_block_mode_commands_spec.lua b/test/functional/legacy/039_visual_block_mode_commands_spec.lua index b0f6eff851..cbaa466621 100644 --- a/test/functional/legacy/039_visual_block_mode_commands_spec.lua +++ b/test/functional/legacy/039_visual_block_mode_commands_spec.lua @@ -1,7 +1,7 @@ -- Test Visual block mode commands -- And test "U" in Visual mode, also on German sharp S. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim, eq = t.api, t.eq local insert, feed = t.insert, t.feed local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/043_magic_settings_spec.lua b/test/functional/legacy/043_magic_settings_spec.lua index c45c8ac6ee..26ccba27c6 100644 --- a/test/functional/legacy/043_magic_settings_spec.lua +++ b/test/functional/legacy/043_magic_settings_spec.lua @@ -1,6 +1,6 @@ -- Tests for regexp with various magic settings. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua index a8de7784e8..89c5b3cbb2 100644 --- a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua +++ b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua @@ -3,7 +3,7 @@ -- -- This test contains both "test44" and "test99" from the old test suite. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/046_multi_line_regexps_spec.lua b/test/functional/legacy/046_multi_line_regexps_spec.lua index 2392cdd5b0..130f238d76 100644 --- a/test/functional/legacy/046_multi_line_regexps_spec.lua +++ b/test/functional/legacy/046_multi_line_regexps_spec.lua @@ -1,7 +1,7 @@ -- vim: set foldmethod=marker foldmarker=[[,]] : -- Tests for multi-line regexps with ":s" -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local expect = t.expect diff --git a/test/functional/legacy/054_buffer_local_autocommands_spec.lua b/test/functional/legacy/054_buffer_local_autocommands_spec.lua index 357f8bf134..ddf807a4aa 100644 --- a/test/functional/legacy/054_buffer_local_autocommands_spec.lua +++ b/test/functional/legacy/054_buffer_local_autocommands_spec.lua @@ -1,6 +1,6 @@ -- Some tests for buffer-local autocommands -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local expect = t.expect diff --git a/test/functional/legacy/055_list_and_dict_types_spec.lua b/test/functional/legacy/055_list_and_dict_types_spec.lua index fad9826520..ecde375a6b 100644 --- a/test/functional/legacy/055_list_and_dict_types_spec.lua +++ b/test/functional/legacy/055_list_and_dict_types_spec.lua @@ -1,6 +1,6 @@ -- Tests for List and Dictionary types. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, source = t.feed, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/056_script_local_function_spec.lua b/test/functional/legacy/056_script_local_function_spec.lua index d1aa76130d..50c34ce869 100644 --- a/test/functional/legacy/056_script_local_function_spec.lua +++ b/test/functional/legacy/056_script_local_function_spec.lua @@ -1,7 +1,7 @@ -- vim: set foldmethod=marker foldmarker=[[,]] : -- Test for script-local function. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local expect = t.expect diff --git a/test/functional/legacy/057_sort_spec.lua b/test/functional/legacy/057_sort_spec.lua index d34ebffd0d..8fa301a861 100644 --- a/test/functional/legacy/057_sort_spec.lua +++ b/test/functional/legacy/057_sort_spec.lua @@ -1,6 +1,6 @@ -- Tests for :sort command. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, command, clear, expect, eq, poke_eventloop = t.insert, t.command, t.clear, t.expect, t.eq, t.poke_eventloop diff --git a/test/functional/legacy/060_exists_and_has_functions_spec.lua b/test/functional/legacy/060_exists_and_has_functions_spec.lua index 4fa663477c..2f0e6f20e0 100644 --- a/test/functional/legacy/060_exists_and_has_functions_spec.lua +++ b/test/functional/legacy/060_exists_and_has_functions_spec.lua @@ -1,6 +1,6 @@ -- Tests for the exists() and has() functions. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local source = t.source local clear, expect = t.clear, t.expect local write_file = t.write_file diff --git a/test/functional/legacy/061_undo_tree_spec.lua b/test/functional/legacy/061_undo_tree_spec.lua index da065f30b0..cadaf021e7 100644 --- a/test/functional/legacy/061_undo_tree_spec.lua +++ b/test/functional/legacy/061_undo_tree_spec.lua @@ -1,5 +1,5 @@ -- Tests for undo tree and :earlier and :later. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed_command = t.feed_command local write_file = t.write_file diff --git a/test/functional/legacy/063_match_and_matchadd_spec.lua b/test/functional/legacy/063_match_and_matchadd_spec.lua index c36a0e0368..5a9817927b 100644 --- a/test/functional/legacy/063_match_and_matchadd_spec.lua +++ b/test/functional/legacy/063_match_and_matchadd_spec.lua @@ -1,6 +1,6 @@ -- Tests for adjusting window and contents -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, command = t.clear, t.command diff --git a/test/functional/legacy/065_float_and_logic_operators_spec.lua b/test/functional/legacy/065_float_and_logic_operators_spec.lua index d9920ac20b..6a86c6b360 100644 --- a/test/functional/legacy/065_float_and_logic_operators_spec.lua +++ b/test/functional/legacy/065_float_and_logic_operators_spec.lua @@ -1,6 +1,6 @@ -- Test for floating point and logical operators. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/066_visual_block_tab_spec.lua b/test/functional/legacy/066_visual_block_tab_spec.lua index 65e756f13e..bd0b6eb14f 100644 --- a/test/functional/legacy/066_visual_block_tab_spec.lua +++ b/test/functional/legacy/066_visual_block_tab_spec.lua @@ -1,7 +1,7 @@ -- vim: set foldmethod=marker foldmarker=[[,]] : -- Test for visual block shift and tab characters. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/067_augroup_exists_spec.lua b/test/functional/legacy/067_augroup_exists_spec.lua index 15db32566b..65f4a9b3c2 100644 --- a/test/functional/legacy/067_augroup_exists_spec.lua +++ b/test/functional/legacy/067_augroup_exists_spec.lua @@ -1,7 +1,7 @@ -- Test that groups and patterns are tested correctly when calling exists() for -- autocommands. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command, expect = t.command, t.expect diff --git a/test/functional/legacy/068_text_formatting_spec.lua b/test/functional/legacy/068_text_formatting_spec.lua index a74df07311..ece2fb25d4 100644 --- a/test/functional/legacy/068_text_formatting_spec.lua +++ b/test/functional/legacy/068_text_formatting_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear = t.clear diff --git a/test/functional/legacy/069_multibyte_formatting_spec.lua b/test/functional/legacy/069_multibyte_formatting_spec.lua index 321c718fe2..300c915ca9 100644 --- a/test/functional/legacy/069_multibyte_formatting_spec.lua +++ b/test/functional/legacy/069_multibyte_formatting_spec.lua @@ -3,7 +3,7 @@ -- And test "ra" on multibyte characters. -- Also test byteidx() and byteidxcomp() -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, eq, eval, clear, feed_command, expect = t.feed, t.insert, t.eq, t.eval, t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/072_undo_file_spec.lua b/test/functional/legacy/072_undo_file_spec.lua index a9eb93b31d..e2785027f7 100644 --- a/test/functional/legacy/072_undo_file_spec.lua +++ b/test/functional/legacy/072_undo_file_spec.lua @@ -2,7 +2,7 @@ -- Since this script is sourced we need to explicitly break changes up in -- undo-able pieces. Do that by setting 'undolevels'. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/074_global_var_in_viminfo_spec.lua b/test/functional/legacy/074_global_var_in_viminfo_spec.lua index 81f3d4c3b1..fa4129b9d8 100644 --- a/test/functional/legacy/074_global_var_in_viminfo_spec.lua +++ b/test/functional/legacy/074_global_var_in_viminfo_spec.lua @@ -1,6 +1,6 @@ -- Tests for storing global variables in the .shada file -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command, eq, neq, eval, poke_eventloop = t.clear, t.command, t.eq, t.neq, t.eval, t.poke_eventloop diff --git a/test/functional/legacy/078_swapfile_recover_spec.lua b/test/functional/legacy/078_swapfile_recover_spec.lua index 6ee9a061bf..40970ebfdb 100644 --- a/test/functional/legacy/078_swapfile_recover_spec.lua +++ b/test/functional/legacy/078_swapfile_recover_spec.lua @@ -3,7 +3,7 @@ -- restored. We need about 10000 lines of 100 characters to get two levels of -- pointer blocks. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, expect, source = t.clear, t.expect, t.source describe('78', function() diff --git a/test/functional/legacy/081_coptions_movement_spec.lua b/test/functional/legacy/081_coptions_movement_spec.lua index bf477c66fc..945eb696e5 100644 --- a/test/functional/legacy/081_coptions_movement_spec.lua +++ b/test/functional/legacy/081_coptions_movement_spec.lua @@ -1,6 +1,6 @@ -- Test for t movement command and 'cpo-;' setting -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/082_string_comparison_spec.lua b/test/functional/legacy/082_string_comparison_spec.lua index 83d7179014..89c3c65a38 100644 --- a/test/functional/legacy/082_string_comparison_spec.lua +++ b/test/functional/legacy/082_string_comparison_spec.lua @@ -1,7 +1,7 @@ -- Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c) -- Also test "g~ap". -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, source = t.feed, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/083_tag_search_with_file_encoding_spec.lua b/test/functional/legacy/083_tag_search_with_file_encoding_spec.lua index 3c5d1d38d8..03c699cfa7 100644 --- a/test/functional/legacy/083_tag_search_with_file_encoding_spec.lua +++ b/test/functional/legacy/083_tag_search_with_file_encoding_spec.lua @@ -1,6 +1,6 @@ -- Tests for tag search with !_TAG_FILE_ENCODING. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source, clear, expect, write_file = t.insert, t.source, t.clear, t.expect, t.write_file diff --git a/test/functional/legacy/090_sha256_spec.lua b/test/functional/legacy/090_sha256_spec.lua index 29c3560caa..98b15014cf 100644 --- a/test/functional/legacy/090_sha256_spec.lua +++ b/test/functional/legacy/090_sha256_spec.lua @@ -1,6 +1,6 @@ -- Tests for sha256() function. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/091_context_variables_spec.lua b/test/functional/legacy/091_context_variables_spec.lua index e9f8458f80..fa892cb410 100644 --- a/test/functional/legacy/091_context_variables_spec.lua +++ b/test/functional/legacy/091_context_variables_spec.lua @@ -1,6 +1,6 @@ -- Tests for getbufvar(), getwinvar(), gettabvar() and gettabwinvar(). -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua b/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua index 6e12c61d9d..706bf13a1f 100644 --- a/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua +++ b/test/functional/legacy/092_mksession_cursor_cols_utf8_spec.lua @@ -3,7 +3,7 @@ -- -- Same as legacy test 93 but using UTF-8 file encoding. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua index a3b1a01a8c..1d513189d4 100644 --- a/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua +++ b/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua @@ -3,7 +3,7 @@ -- -- Same as legacy test 92 but using Latin-1 file encoding. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/094_visual_mode_operators_spec.lua b/test/functional/legacy/094_visual_mode_operators_spec.lua index 44f3cbecf2..e3f3d3cdf3 100644 --- a/test/functional/legacy/094_visual_mode_operators_spec.lua +++ b/test/functional/legacy/094_visual_mode_operators_spec.lua @@ -4,7 +4,7 @@ -- followed by an operator and those executed via Operator-pending mode. Also -- part of the test are mappings, counts, and repetition with the . command. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, source = t.feed, t.insert, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/095_regexp_multibyte_spec.lua b/test/functional/legacy/095_regexp_multibyte_spec.lua index 25524721ab..b62666bfd5 100644 --- a/test/functional/legacy/095_regexp_multibyte_spec.lua +++ b/test/functional/legacy/095_regexp_multibyte_spec.lua @@ -3,7 +3,7 @@ -- A pattern that gives the expected result produces OK, so that we know it was -- actually tried. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/096_location_list_spec.lua b/test/functional/legacy/096_location_list_spec.lua index e105664522..cacdc15ecb 100644 --- a/test/functional/legacy/096_location_list_spec.lua +++ b/test/functional/legacy/096_location_list_spec.lua @@ -6,7 +6,7 @@ -- C. make sure that the location list window is not reused instead of the window -- it belongs to. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local source = t.source local clear, command, expect = t.clear, t.command, t.expect diff --git a/test/functional/legacy/097_glob_path_spec.lua b/test/functional/legacy/097_glob_path_spec.lua index d2d68cc35d..566918bc60 100644 --- a/test/functional/legacy/097_glob_path_spec.lua +++ b/test/functional/legacy/097_glob_path_spec.lua @@ -2,7 +2,7 @@ -- Test whether glob()/globpath() return correct results with certain escaped -- characters. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command, expect = t.command, t.expect diff --git a/test/functional/legacy/101_hlsearch_spec.lua b/test/functional/legacy/101_hlsearch_spec.lua index c76c295eae..fa3ffbe180 100644 --- a/test/functional/legacy/101_hlsearch_spec.lua +++ b/test/functional/legacy/101_hlsearch_spec.lua @@ -1,6 +1,6 @@ -- Test for v:hlsearch -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed = t.clear, t.feed local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/102_fnameescape_spec.lua b/test/functional/legacy/102_fnameescape_spec.lua index 651c6fa41d..25b4706217 100644 --- a/test/functional/legacy/102_fnameescape_spec.lua +++ b/test/functional/legacy/102_fnameescape_spec.lua @@ -1,6 +1,6 @@ -- Test if fnameescape is correct for special chars like! -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command, expect = t.command, t.expect diff --git a/test/functional/legacy/103_visual_mode_reset_spec.lua b/test/functional/legacy/103_visual_mode_reset_spec.lua index 2f43a0e8cd..e8aeb1305a 100644 --- a/test/functional/legacy/103_visual_mode_reset_spec.lua +++ b/test/functional/legacy/103_visual_mode_reset_spec.lua @@ -1,6 +1,6 @@ -- Test for visual mode not being reset causing E315 error. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, source = t.feed, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/106_errorformat_spec.lua b/test/functional/legacy/106_errorformat_spec.lua index cdbf9b9c5b..4094e9209a 100644 --- a/test/functional/legacy/106_errorformat_spec.lua +++ b/test/functional/legacy/106_errorformat_spec.lua @@ -1,6 +1,6 @@ -- Tests for errorformat. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command, expect = t.command, t.expect diff --git a/test/functional/legacy/107_adjust_window_and_contents_spec.lua b/test/functional/legacy/107_adjust_window_and_contents_spec.lua index ec5a3e8443..cc9f9947c7 100644 --- a/test/functional/legacy/107_adjust_window_and_contents_spec.lua +++ b/test/functional/legacy/107_adjust_window_and_contents_spec.lua @@ -1,6 +1,6 @@ -- Tests for adjusting window and contents -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/108_backtrace_debug_commands_spec.lua b/test/functional/legacy/108_backtrace_debug_commands_spec.lua index ae63244c00..924f8f0051 100644 --- a/test/functional/legacy/108_backtrace_debug_commands_spec.lua +++ b/test/functional/legacy/108_backtrace_debug_commands_spec.lua @@ -1,6 +1,6 @@ -- Tests for backtrace debug commands. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command = t.command local feed, clear = t.feed, t.clear local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/arglist_spec.lua b/test/functional/legacy/arglist_spec.lua index bdcac04da3..9915e9fecc 100644 --- a/test/functional/legacy/arglist_spec.lua +++ b/test/functional/legacy/arglist_spec.lua @@ -1,6 +1,6 @@ -- Test argument list commands -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, command, eq = t.clear, t.command, t.eq local expect_exit = t.expect_exit diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index 14b9e2d636..3373234646 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim, call = t.api, t.call local clear, eq = t.clear, t.eq local source, command = t.source, t.command diff --git a/test/functional/legacy/autochdir_spec.lua b/test/functional/legacy/autochdir_spec.lua index 84fb897d5b..5ab502eebd 100644 --- a/test/functional/legacy/autochdir_spec.lua +++ b/test/functional/legacy/autochdir_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, matches = t.clear, t.eq, t.matches local eval, command, call, api = t.eval, t.command, t.call, t.api local source, exec_capture = t.source, t.exec_capture diff --git a/test/functional/legacy/autocmd_option_spec.lua b/test/functional/legacy/autocmd_option_spec.lua index 4b919db9ce..8cd85897ab 100644 --- a/test/functional/legacy/autocmd_option_spec.lua +++ b/test/functional/legacy/autocmd_option_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim = t.api local clear, eq, neq, eval = t.clear, t.eq, t.neq, t.eval local api = t.api diff --git a/test/functional/legacy/autocmd_spec.lua b/test/functional/legacy/autocmd_spec.lua index bc0c0cd556..cf35544f17 100644 --- a/test/functional/legacy/autocmd_spec.lua +++ b/test/functional/legacy/autocmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local write_file = t.write_file local command = t.command diff --git a/test/functional/legacy/autoformat_join_spec.lua b/test/functional/legacy/autoformat_join_spec.lua index 32465a91cd..0f14113602 100644 --- a/test/functional/legacy/autoformat_join_spec.lua +++ b/test/functional/legacy/autoformat_join_spec.lua @@ -1,6 +1,6 @@ -- Tests for setting the '[,'] marks when joining lines. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local command, expect = t.command, t.expect local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/breakindent_spec.lua b/test/functional/legacy/breakindent_spec.lua index b6deaae6b5..2e32e8d5f6 100644 --- a/test/functional/legacy/breakindent_spec.lua +++ b/test/functional/legacy/breakindent_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/changelist_spec.lua b/test/functional/legacy/changelist_spec.lua index 4cf8c9bcdb..360c73b1e8 100644 --- a/test/functional/legacy/changelist_spec.lua +++ b/test/functional/legacy/changelist_spec.lua @@ -1,7 +1,7 @@ -- Test changelist position after splitting window -- Set 'undolevels' to make changelist for sourced file -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/charsearch_spec.lua b/test/functional/legacy/charsearch_spec.lua index b228460528..20d0e1e79d 100644 --- a/test/functional/legacy/charsearch_spec.lua +++ b/test/functional/legacy/charsearch_spec.lua @@ -1,6 +1,6 @@ -- Test for character searches -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert = t.feed, t.insert local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/close_count_spec.lua b/test/functional/legacy/close_count_spec.lua index 4f81026fb2..74b01d7fa6 100644 --- a/test/functional/legacy/close_count_spec.lua +++ b/test/functional/legacy/close_count_spec.lua @@ -1,6 +1,6 @@ -- Tests for :[count]close! and :[count]hide -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local poke_eventloop = t.poke_eventloop diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index 4a5f1b1b61..f2a0f336c0 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/command_count_spec.lua b/test/functional/legacy/command_count_spec.lua index 7e10711e0b..c4ca46984c 100644 --- a/test/functional/legacy/command_count_spec.lua +++ b/test/functional/legacy/command_count_spec.lua @@ -1,6 +1,6 @@ -- Test for user command counts -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, source, expect = t.clear, t.source, t.expect local feed_command = t.feed_command diff --git a/test/functional/legacy/comparators_spec.lua b/test/functional/legacy/comparators_spec.lua index 055b260be1..582ec6d6dc 100644 --- a/test/functional/legacy/comparators_spec.lua +++ b/test/functional/legacy/comparators_spec.lua @@ -1,6 +1,6 @@ -- " Test for expression comparators. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq = t.clear, t.eq local eval, command = t.eval, t.command diff --git a/test/functional/legacy/conceal_spec.lua b/test/functional/legacy/conceal_spec.lua index 287ccd10ff..d53107117b 100644 --- a/test/functional/legacy/conceal_spec.lua +++ b/test/functional/legacy/conceal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/cpoptions_spec.lua b/test/functional/legacy/cpoptions_spec.lua index 74328ad353..0acdcf2e4d 100644 --- a/test/functional/legacy/cpoptions_spec.lua +++ b/test/functional/legacy/cpoptions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/crash_spec.lua b/test/functional/legacy/crash_spec.lua index 66ca61fb67..fd9dd18e0e 100644 --- a/test/functional/legacy/crash_spec.lua +++ b/test/functional/legacy/crash_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local clear = t.clear local command = t.command diff --git a/test/functional/legacy/debugger_spec.lua b/test/functional/legacy/debugger_spec.lua index 2d682d5073..a76cdbc043 100644 --- a/test/functional/legacy/debugger_spec.lua +++ b/test/functional/legacy/debugger_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/delete_spec.lua b/test/functional/legacy/delete_spec.lua index 4cf3893e01..82958f3bde 100644 --- a/test/functional/legacy/delete_spec.lua +++ b/test/functional/legacy/delete_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, source = t.clear, t.source local eq, eval, command = t.eq, t.eval, t.command local exc_exec = t.exc_exec diff --git a/test/functional/legacy/digraph_spec.lua b/test/functional/legacy/digraph_spec.lua index 5ee899d859..687f5520b7 100644 --- a/test/functional/legacy/digraph_spec.lua +++ b/test/functional/legacy/digraph_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local feed = t.feed diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua index 90a2860083..f547a8b637 100644 --- a/test/functional/legacy/display_spec.lua +++ b/test/functional/legacy/display_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/legacy/edit_spec.lua b/test/functional/legacy/edit_spec.lua index 86cce91e76..c79213656f 100644 --- a/test/functional/legacy/edit_spec.lua +++ b/test/functional/legacy/edit_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/erasebackword_spec.lua b/test/functional/legacy/erasebackword_spec.lua index 44d93db125..cd26edf29d 100644 --- a/test/functional/legacy/erasebackword_spec.lua +++ b/test/functional/legacy/erasebackword_spec.lua @@ -1,6 +1,6 @@ -- Test for CTRL-W in Insert mode -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, expect = t.clear, t.feed, t.expect describe('CTRL-W in Insert mode', function() diff --git a/test/functional/legacy/eval_spec.lua b/test/functional/legacy/eval_spec.lua index d0bbda437a..5e269bbef5 100644 --- a/test/functional/legacy/eval_spec.lua +++ b/test/functional/legacy/eval_spec.lua @@ -1,6 +1,6 @@ -- Test for various eval features. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local feed, insert, source = t.feed, t.insert, t.source local clear, command, expect = t.clear, t.command, t.expect diff --git a/test/functional/legacy/ex_mode_spec.lua b/test/functional/legacy/ex_mode_spec.lua index bf173a9712..6914a3a3ad 100644 --- a/test/functional/legacy/ex_mode_spec.lua +++ b/test/functional/legacy/ex_mode_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/excmd_spec.lua b/test/functional/legacy/excmd_spec.lua index 7b282a7890..3404ebe098 100644 --- a/test/functional/legacy/excmd_spec.lua +++ b/test/functional/legacy/excmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/fixeol_spec.lua b/test/functional/legacy/fixeol_spec.lua index 5b6c34c7ae..89bc3b78c9 100644 --- a/test/functional/legacy/fixeol_spec.lua +++ b/test/functional/legacy/fixeol_spec.lua @@ -1,6 +1,6 @@ -- Tests for 'fixeol' -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed = t.feed local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/fnamemodify_spec.lua b/test/functional/legacy/fnamemodify_spec.lua index 0e6701c8dd..a535ca3dba 100644 --- a/test/functional/legacy/fnamemodify_spec.lua +++ b/test/functional/legacy/fnamemodify_spec.lua @@ -1,6 +1,6 @@ -- Test filename modifiers. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, source = t.clear, t.source local call, eq, nvim = t.call, t.eq, t.api diff --git a/test/functional/legacy/fold_spec.lua b/test/functional/legacy/fold_spec.lua index 2ec6f2ee8d..91d7c1cfcd 100644 --- a/test/functional/legacy/fold_spec.lua +++ b/test/functional/legacy/fold_spec.lua @@ -1,7 +1,7 @@ -- Tests for folding. local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, feed_command, expect_any = t.feed, t.insert, t.feed_command, t.expect_any local command = t.command local exec = t.exec diff --git a/test/functional/legacy/function_sort_spec.lua b/test/functional/legacy/function_sort_spec.lua index d77691d0ac..e820d20918 100644 --- a/test/functional/legacy/function_sort_spec.lua +++ b/test/functional/legacy/function_sort_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local neq = t.neq diff --git a/test/functional/legacy/getcwd_spec.lua b/test/functional/legacy/getcwd_spec.lua index 134d664236..542bfefb89 100644 --- a/test/functional/legacy/getcwd_spec.lua +++ b/test/functional/legacy/getcwd_spec.lua @@ -1,6 +1,6 @@ -- Tests for getcwd(), haslocaldir(), and :lcd -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, eval, source = t.eq, t.eval, t.source local call, clear, command = t.call, t.clear, t.command diff --git a/test/functional/legacy/gf_spec.lua b/test/functional/legacy/gf_spec.lua index e9630f2180..37722a88bc 100644 --- a/test/functional/legacy/gf_spec.lua +++ b/test/functional/legacy/gf_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/legacy/glob2regpat_spec.lua b/test/functional/legacy/glob2regpat_spec.lua index 8a16eefa6c..47205a6383 100644 --- a/test/functional/legacy/glob2regpat_spec.lua +++ b/test/functional/legacy/glob2regpat_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq, eval = t.eq, t.eval diff --git a/test/functional/legacy/global_spec.lua b/test/functional/legacy/global_spec.lua index 37034241ec..c22529b3d5 100644 --- a/test/functional/legacy/global_spec.lua +++ b/test/functional/legacy/global_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/highlight_spec.lua b/test/functional/legacy/highlight_spec.lua index 90d091c0f7..a2e6bd2c1f 100644 --- a/test/functional/legacy/highlight_spec.lua +++ b/test/functional/legacy/highlight_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed = t.clear, t.feed local expect = t.expect local eq = t.eq diff --git a/test/functional/legacy/increment_spec.lua b/test/functional/legacy/increment_spec.lua index 8368b5f2de..8aae9dc698 100644 --- a/test/functional/legacy/increment_spec.lua +++ b/test/functional/legacy/increment_spec.lua @@ -1,6 +1,6 @@ -- Tests for using Ctrl-A/Ctrl-X on visual selections -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local source, command = t.source, t.command local call, clear = t.call, t.clear local eq, nvim = t.eq, t.api diff --git a/test/functional/legacy/insertcount_spec.lua b/test/functional/legacy/insertcount_spec.lua index 7669c97be2..68d88cfc2d 100644 --- a/test/functional/legacy/insertcount_spec.lua +++ b/test/functional/legacy/insertcount_spec.lua @@ -1,6 +1,6 @@ -- Tests for repeating insert and replace. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect = t.feed_command, t.expect diff --git a/test/functional/legacy/join_spec.lua b/test/functional/legacy/join_spec.lua index 4e9e3a542c..8a182efb03 100644 --- a/test/functional/legacy/join_spec.lua +++ b/test/functional/legacy/join_spec.lua @@ -1,6 +1,6 @@ -- Test for joining lines -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq = t.clear, t.eq local eval, command = t.eval, t.command diff --git a/test/functional/legacy/lispwords_spec.lua b/test/functional/legacy/lispwords_spec.lua index 6af7747049..f9535266de 100644 --- a/test/functional/legacy/lispwords_spec.lua +++ b/test/functional/legacy/lispwords_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local eval = t.eval diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index cdbdaf288f..c889fb9fe5 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -1,6 +1,6 @@ -- Tests for 'listchars' display with 'list' and :list. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed, insert, exec = t.feed, t.insert, t.exec local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/listlbr_spec.lua b/test/functional/legacy/listlbr_spec.lua index eeeab310c4..89f6c43019 100644 --- a/test/functional/legacy/listlbr_spec.lua +++ b/test/functional/legacy/listlbr_spec.lua @@ -1,6 +1,6 @@ -- Test for linebreak and list option (non-utf8) -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed, insert, source = t.feed, t.insert, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index 89799ac0fc..f912aee5aa 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -1,6 +1,6 @@ -- Test for linebreak and list option in utf-8 mode -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local source = t.source local feed = t.feed diff --git a/test/functional/legacy/mapping_spec.lua b/test/functional/legacy/mapping_spec.lua index ff3c553a8e..272a79fa29 100644 --- a/test/functional/legacy/mapping_spec.lua +++ b/test/functional/legacy/mapping_spec.lua @@ -1,6 +1,6 @@ -- Test for mappings and abbreviations -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local expect, poke_eventloop = t.expect, t.poke_eventloop local command, eq, eval, api = t.command, t.eq, t.eval, t.api diff --git a/test/functional/legacy/marks_spec.lua b/test/functional/legacy/marks_spec.lua index ace8c35f63..e259d61dc4 100644 --- a/test/functional/legacy/marks_spec.lua +++ b/test/functional/legacy/marks_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, source = t.feed, t.insert, t.source local clear, feed_command, expect = t.clear, t.feed_command, t.expect diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index 8d04fde602..aa81862c94 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/matchparen_spec.lua b/test/functional/legacy/matchparen_spec.lua index 0a21efeb7c..f454eee362 100644 --- a/test/functional/legacy/matchparen_spec.lua +++ b/test/functional/legacy/matchparen_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/legacy/memory_usage_spec.lua b/test/functional/legacy/memory_usage_spec.lua index aba20387ef..894fa7bf03 100644 --- a/test/functional/legacy/memory_usage_spec.lua +++ b/test/functional/legacy/memory_usage_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eval = t.eval local eq = t.eq diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index 1a929f1397..ddf234e0b5 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/mksession_spec.lua b/test/functional/legacy/mksession_spec.lua index edad8f58f2..fbb016008b 100644 --- a/test/functional/legacy/mksession_spec.lua +++ b/test/functional/legacy/mksession_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local fn = t.fn diff --git a/test/functional/legacy/move_spec.lua b/test/functional/legacy/move_spec.lua index 2368b9ae83..1ad980e08f 100644 --- a/test/functional/legacy/move_spec.lua +++ b/test/functional/legacy/move_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local feed = t.feed diff --git a/test/functional/legacy/nested_function_spec.lua b/test/functional/legacy/nested_function_spec.lua index 3631b76a3d..2bff8390c1 100644 --- a/test/functional/legacy/nested_function_spec.lua +++ b/test/functional/legacy/nested_function_spec.lua @@ -1,6 +1,6 @@ -- Tests for nested function. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, insert = t.clear, t.insert local command, expect, source = t.command, t.expect, t.source diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua index c57e51c18e..43019d4216 100644 --- a/test/functional/legacy/normal_spec.lua +++ b/test/functional/legacy/normal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/number_spec.lua b/test/functional/legacy/number_spec.lua index 3d00169946..7a41e2af86 100644 --- a/test/functional/legacy/number_spec.lua +++ b/test/functional/legacy/number_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/options_spec.lua b/test/functional/legacy/options_spec.lua index c7d6457eb7..a3f6e00c83 100644 --- a/test/functional/legacy/options_spec.lua +++ b/test/functional/legacy/options_spec.lua @@ -1,5 +1,5 @@ -- See also: test/old/testdir/test_options.vim -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command, clear = t.command, t.clear local source, expect = t.source, t.expect local exc_exec = t.exc_exec diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua index 782992d052..dfabfd9645 100644 --- a/test/functional/legacy/prompt_buffer_spec.lua +++ b/test/functional/legacy/prompt_buffer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed local source = t.source diff --git a/test/functional/legacy/put_spec.lua b/test/functional/legacy/put_spec.lua index e0c261b6d9..2030d2805b 100644 --- a/test/functional/legacy/put_spec.lua +++ b/test/functional/legacy/put_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/functional/legacy/qf_title_spec.lua b/test/functional/legacy/qf_title_spec.lua index 7359ad1f8a..e9b49fad50 100644 --- a/test/functional/legacy/qf_title_spec.lua +++ b/test/functional/legacy/qf_title_spec.lua @@ -1,6 +1,6 @@ -- Tests for quickfix window's title -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local insert, source = t.insert, t.source local clear, expect = t.clear, t.expect diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 2720b9f337..c6880b5a0e 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/search_mbyte_spec.lua b/test/functional/legacy/search_mbyte_spec.lua index c8eef8e330..632d95b444 100644 --- a/test/functional/legacy/search_mbyte_spec.lua +++ b/test/functional/legacy/search_mbyte_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local poke_eventloop = t.poke_eventloop local clear = t.clear diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 7b4cd90d9d..cc8f775056 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/legacy/search_stat_spec.lua b/test/functional/legacy/search_stat_spec.lua index ee49cd1bcb..b71a48fff2 100644 --- a/test/functional/legacy/search_stat_spec.lua +++ b/test/functional/legacy/search_stat_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, exec, command = t.clear, t.feed, t.exec, t.command diff --git a/test/functional/legacy/signs_spec.lua b/test/functional/legacy/signs_spec.lua index e240e1c87a..e58d34acd9 100644 --- a/test/functional/legacy/signs_spec.lua +++ b/test/functional/legacy/signs_spec.lua @@ -1,6 +1,6 @@ -- Tests for signs -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command, expect = t.clear, t.command, t.expect describe('signs', function() diff --git a/test/functional/legacy/source_spec.lua b/test/functional/legacy/source_spec.lua index 2b9cf0b124..31ae4ed9b8 100644 --- a/test/functional/legacy/source_spec.lua +++ b/test/functional/legacy/source_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local feed = t.feed diff --git a/test/functional/legacy/statusline_spec.lua b/test/functional/legacy/statusline_spec.lua index 6c508aa7f8..ba7376ff1b 100644 --- a/test/functional/legacy/statusline_spec.lua +++ b/test/functional/legacy/statusline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/substitute_spec.lua b/test/functional/legacy/substitute_spec.lua index 6a2750d46d..d540a7fdeb 100644 --- a/test/functional/legacy/substitute_spec.lua +++ b/test/functional/legacy/substitute_spec.lua @@ -2,7 +2,7 @@ -- Test for submatch() on substitute(). -- Test for *:s%* on :substitute. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed, insert = t.feed, t.insert local exec = t.exec diff --git a/test/functional/legacy/syn_attr_spec.lua b/test/functional/legacy/syn_attr_spec.lua index 153e20fc94..13b3752ff4 100644 --- a/test/functional/legacy/syn_attr_spec.lua +++ b/test/functional/legacy/syn_attr_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/legacy/tabline_spec.lua b/test/functional/legacy/tabline_spec.lua index d92f46b8eb..da8a525b6d 100644 --- a/test/functional/legacy/tabline_spec.lua +++ b/test/functional/legacy/tabline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/tagcase_spec.lua b/test/functional/legacy/tagcase_spec.lua index ae80282ed6..54251aad1c 100644 --- a/test/functional/legacy/tagcase_spec.lua +++ b/test/functional/legacy/tagcase_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local eval = t.eval diff --git a/test/functional/legacy/textobjects_spec.lua b/test/functional/legacy/textobjects_spec.lua index ed22c26c48..52986e6be0 100644 --- a/test/functional/legacy/textobjects_spec.lua +++ b/test/functional/legacy/textobjects_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local call = t.call local clear = t.clear local command = t.command diff --git a/test/functional/legacy/undolevels_spec.lua b/test/functional/legacy/undolevels_spec.lua index f6beb28dea..1968f8c599 100644 --- a/test/functional/legacy/undolevels_spec.lua +++ b/test/functional/legacy/undolevels_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local source, clear = t.source, t.clear local eq, nvim = t.eq, t.api diff --git a/test/functional/legacy/utf8_spec.lua b/test/functional/legacy/utf8_spec.lua index 155352a0c2..8213986c62 100644 --- a/test/functional/legacy/utf8_spec.lua +++ b/test/functional/legacy/utf8_spec.lua @@ -1,6 +1,6 @@ -- Tests for Unicode manipulations -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, insert = t.clear, t.feed, t.insert local command, expect = t.command, t.expect local eq, eval = t.eq, t.eval diff --git a/test/functional/legacy/vimscript_spec.lua b/test/functional/legacy/vimscript_spec.lua index 7083745b54..494860932e 100644 --- a/test/functional/legacy/vimscript_spec.lua +++ b/test/functional/legacy/vimscript_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/visual_spec.lua b/test/functional/legacy/visual_spec.lua index 0a09ccff73..9fa22c7d87 100644 --- a/test/functional/legacy/visual_spec.lua +++ b/test/functional/legacy/visual_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index 0ea654dd0d..8fcb9fd53e 100644 --- a/test/functional/legacy/window_cmd_spec.lua +++ b/test/functional/legacy/window_cmd_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/legacy/wordcount_spec.lua b/test/functional/legacy/wordcount_spec.lua index 0b5cba52f0..946668e2d3 100644 --- a/test/functional/legacy/wordcount_spec.lua +++ b/test/functional/legacy/wordcount_spec.lua @@ -1,6 +1,6 @@ -- Test for wordcount() function -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local feed, insert, source = t.feed, t.insert, t.source local clear, command = t.clear, t.command local eq, eval = t.eq, t.eval diff --git a/test/functional/legacy/writefile_spec.lua b/test/functional/legacy/writefile_spec.lua index 63ea4e3f11..6ba3056377 100644 --- a/test/functional/legacy/writefile_spec.lua +++ b/test/functional/legacy/writefile_spec.lua @@ -1,6 +1,6 @@ -- Tests for writefile() -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command, expect = t.clear, t.command, t.expect describe('writefile', function() diff --git a/test/functional/lua/api_spec.lua b/test/functional/lua/api_spec.lua index 0aa63327ad..a9bcb05c16 100644 --- a/test/functional/lua/api_spec.lua +++ b/test/functional/lua/api_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exc_exec = t.exc_exec local remove_trace = t.remove_trace diff --git a/test/functional/lua/base64_spec.lua b/test/functional/lua/base64_spec.lua index 9410a6fd6f..bb986c3220 100644 --- a/test/functional/lua/base64_spec.lua +++ b/test/functional/lua/base64_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 7ee4100137..0969c8f137 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local command = t.command diff --git a/test/functional/lua/command_line_completion_spec.lua b/test/functional/lua/command_line_completion_spec.lua index 41e807f086..4dc0356283 100644 --- a/test/functional/lua/command_line_completion_spec.lua +++ b/test/functional/lua/command_line_completion_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua index 04188281bc..d0418fce26 100644 --- a/test/functional/lua/commands_spec.lua +++ b/test/functional/lua/commands_spec.lua @@ -1,5 +1,5 @@ -- Test suite for checking :lua* commands -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/lua/comment_spec.lua b/test/functional/lua/comment_spec.lua index 3b230780ad..df7776d928 100644 --- a/test/functional/lua/comment_spec.lua +++ b/test/functional/lua/comment_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api = t.api local clear = t.clear @@ -495,22 +495,21 @@ describe('commenting', function() it("recomputes local 'commentstring' based on cursor position", function() setup_treesitter() local lines = { + ' print(1)', 'lua << EOF', ' print(1)', 'EOF', } set_lines(lines) - -- Vimscript's tree-sitter grammar is (currently) written in a way that Lua's - -- injection really starts at the first non-blank character - set_cursor(2, 1) + set_cursor(1, 1) feed('gc_') - eq(get_lines()[2], ' "print(1)') + eq(get_lines()[1], ' "print(1)') set_lines(lines) - set_cursor(2, 2) + set_cursor(3, 2) feed('.') - eq(get_lines()[2], ' -- print(1)') + eq(get_lines()[3], ' -- print(1)') end) it('preserves marks', function() diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua index 152258dd8c..afdf619526 100644 --- a/test/functional/lua/diagnostic_spec.lua +++ b/test/functional/lua/diagnostic_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local NIL = vim.NIL local command = t.command diff --git a/test/functional/lua/ffi_spec.lua b/test/functional/lua/ffi_spec.lua index 2cde9f4f2a..77095fac7a 100644 --- a/test/functional/lua/ffi_spec.lua +++ b/test/functional/lua/ffi_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local exec_lua = t.exec_lua local clear = t.clear diff --git a/test/functional/lua/filetype_spec.lua b/test/functional/lua/filetype_spec.lua index 677d039b81..ffd2a7eb60 100644 --- a/test/functional/lua/filetype_spec.lua +++ b/test/functional/lua/filetype_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local eq = t.eq local api = t.api diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index a0df71b20a..d3bd19e35b 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/functional/lua/glob_spec.lua b/test/functional/lua/glob_spec.lua index dbe1079092..b1408ce92e 100644 --- a/test/functional/lua/glob_spec.lua +++ b/test/functional/lua/glob_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local exec_lua = t.exec_lua diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua index dc80a1672a..dc62fa978c 100644 --- a/test/functional/lua/highlight_spec.lua +++ b/test/functional/lua/highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local eq = t.eq local neq = t.neq diff --git a/test/functional/lua/inspector_spec.lua b/test/functional/lua/inspector_spec.lua index efc710d0d7..3fd8daff2e 100644 --- a/test/functional/lua/inspector_spec.lua +++ b/test/functional/lua/inspector_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local eq = t.eq local eval = t.eval diff --git a/test/functional/lua/iter_spec.lua b/test/functional/lua/iter_spec.lua index 237710242d..10a0810501 100644 --- a/test/functional/lua/iter_spec.lua +++ b/test/functional/lua/iter_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local matches = t.matches local pcall_err = t.pcall_err diff --git a/test/functional/lua/json_spec.lua b/test/functional/lua/json_spec.lua index af545fdfdf..c1a407110c 100644 --- a/test/functional/lua/json_spec.lua +++ b/test/functional/lua/json_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/lua/loader_spec.lua b/test/functional/lua/loader_spec.lua index 89be7a4c09..5cf060ae4b 100644 --- a/test/functional/lua/loader_spec.lua +++ b/test/functional/lua/loader_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local command = t.command diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua index 13ffb97fbb..f5d9a6c39b 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local fn = t.fn local api = t.api diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index 67d5da28a1..51be8798fb 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing luaeval() function -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local pcall_err = t.pcall_err diff --git a/test/functional/lua/mpack_spec.lua b/test/functional/lua/mpack_spec.lua index 28a316dd97..925174a74b 100644 --- a/test/functional/lua/mpack_spec.lua +++ b/test/functional/lua/mpack_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 9b69857cd4..7f325da307 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -1,5 +1,5 @@ -- Test for Vim overrides of lua built-ins -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua index 6acf6ce305..ad685dd8de 100644 --- a/test/functional/lua/runtime_spec.lua +++ b/test/functional/lua/runtime_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/lua/secure_spec.lua b/test/functional/lua/secure_spec.lua index 0a5c67ef38..1a1a939d7c 100644 --- a/test/functional/lua/secure_spec.lua +++ b/test/functional/lua/secure_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua index f1d0493f6e..4dcba42e65 100644 --- a/test/functional/lua/snippet_spec.lua +++ b/test/functional/lua/snippet_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local buf_lines = t.buf_lines local clear = t.clear diff --git a/test/functional/lua/spell_spec.lua b/test/functional/lua/spell_spec.lua index dad223dbe3..f2a81a2578 100644 --- a/test/functional/lua/spell_spec.lua +++ b/test/functional/lua/spell_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/lua/system_spec.lua b/test/functional/lua/system_spec.lua index ba1581bc6b..6730eb98eb 100644 --- a/test/functional/lua/system_spec.lua +++ b/test/functional/lua/system_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/lua/text_spec.lua b/test/functional/lua/text_spec.lua index ecebb88af6..d918ff7918 100644 --- a/test/functional/lua/text_spec.lua +++ b/test/functional/lua/text_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/lua/thread_spec.lua b/test/functional/lua/thread_spec.lua index 6fb70c54d8..ce869291a2 100644 --- a/test/functional/lua/thread_spec.lua +++ b/test/functional/lua/thread_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive local clear = t.clear diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 1283448db5..d6572f9ae5 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq local exec_lua = t.exec_lua diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index eb0a58a4ee..8c9148c6f5 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local matches = t.matches local exec_lua = t.exec_lua diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua index b759e9df21..6cce83005c 100644 --- a/test/functional/lua/uri_spec.lua +++ b/test/functional/lua/uri_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/lua/version_spec.lua b/test/functional/lua/version_spec.lua index 6f25aa3711..ca275f6738 100644 --- a/test/functional/lua/version_spec.lua +++ b/test/functional/lua/version_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local ok = t.ok diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 3757d2843a..6fbac84d96 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local nvim_prog = t.nvim_prog diff --git a/test/functional/lua/watch_spec.lua b/test/functional/lua/watch_spec.lua index 392ad07572..deb8c8955b 100644 --- a/test/functional/lua/watch_spec.lua +++ b/test/functional/lua/watch_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local exec_lua = t.exec_lua local clear = t.clear diff --git a/test/functional/lua/xdiff_spec.lua b/test/functional/lua/xdiff_spec.lua index 3a264385da..0e5dd91fb8 100644 --- a/test/functional/lua/xdiff_spec.lua +++ b/test/functional/lua/xdiff_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua index b05656b043..681f0f5cdd 100644 --- a/test/functional/options/autochdir_spec.lua +++ b/test/functional/options/autochdir_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local fn = t.fn diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua index 9b902092db..4f75c5800a 100644 --- a/test/functional/options/chars_spec.lua +++ b/test/functional/options/chars_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, command = t.clear, t.command local pcall_err = t.pcall_err diff --git a/test/functional/options/cursorbind_spec.lua b/test/functional/options/cursorbind_spec.lua index 2985cc877f..3977d08317 100644 --- a/test/functional/options/cursorbind_spec.lua +++ b/test/functional/options/cursorbind_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index a2fd0afe48..d07ff3da0f 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') diff --git a/test/functional/options/keymap_spec.lua b/test/functional/options/keymap_spec.lua index 4b1b3fbd3f..79b2e3dd0e 100644 --- a/test/functional/options/keymap_spec.lua +++ b/test/functional/options/keymap_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed, eq = t.clear, t.feed, t.eq local expect, command, eval = t.expect, t.command, t.eval local insert, call = t.insert, t.call diff --git a/test/functional/options/modified_spec.lua b/test/functional/options/modified_spec.lua index ab468c4ec8..afd56eef98 100644 --- a/test/functional/options/modified_spec.lua +++ b/test/functional/options/modified_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local api = t.api diff --git a/test/functional/options/mousescroll_spec.lua b/test/functional/options/mousescroll_spec.lua index 82a9c5ad8a..281d6cbe04 100644 --- a/test/functional/options/mousescroll_spec.lua +++ b/test/functional/options/mousescroll_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local command = t.command local clear = t.clear local eval = t.eval diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua index ac7ecd4ab9..7c6d0ea21e 100644 --- a/test/functional/options/num_options_spec.lua +++ b/test/functional/options/num_options_spec.lua @@ -1,6 +1,6 @@ -- Tests for :setlocal and :setglobal -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed_command, eval, eq, api = t.clear, t.feed_command, t.eval, t.eq, t.api local function should_fail(opt, value, errmsg) diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua index b2f82d548b..4fb69b79d8 100644 --- a/test/functional/options/shortmess_spec.lua +++ b/test/functional/options/shortmess_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/options/tabstop_spec.lua b/test/functional/options/tabstop_spec.lua index 36aed914b1..7e9bd5e06c 100644 --- a/test/functional/options/tabstop_spec.lua +++ b/test/functional/options/tabstop_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local clear = t.clear diff --git a/test/functional/options/winfixbuf_spec.lua b/test/functional/options/winfixbuf_spec.lua index 7b214ac9cd..8a0df75782 100644 --- a/test/functional/options/winfixbuf_spec.lua +++ b/test/functional/options/winfixbuf_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/functional/plugin/ccomplete_spec.lua b/test/functional/plugin/ccomplete_spec.lua index 2133f28a2e..bb9b28d300 100644 --- a/test/functional/plugin/ccomplete_spec.lua +++ b/test/functional/plugin/ccomplete_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/plugin/cfilter_spec.lua b/test/functional/plugin/cfilter_spec.lua index 917e666ab0..d421c5fc14 100644 --- a/test/functional/plugin/cfilter_spec.lua +++ b/test/functional/plugin/cfilter_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/plugin/editorconfig_spec.lua b/test/functional/plugin/editorconfig_spec.lua index cd524373da..d108f325e1 100644 --- a/test/functional/plugin/editorconfig_spec.lua +++ b/test/functional/plugin/editorconfig_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local eq = t.eq diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua index 3fe9102886..ef86dcf31e 100644 --- a/test/functional/plugin/health_spec.lua +++ b/test/functional/plugin/health_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/plugin/lsp/codelens_spec.lua b/test/functional/plugin/lsp/codelens_spec.lua index a618854e2f..20e850eeee 100644 --- a/test/functional/plugin/lsp/codelens_spec.lua +++ b/test/functional/plugin/lsp/codelens_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/plugin/lsp/completion_spec.lua b/test/functional/plugin/lsp/completion_spec.lua index fd29a11ead..18f123a979 100644 --- a/test/functional/plugin/lsp/completion_spec.lua +++ b/test/functional/plugin/lsp/completion_spec.lua @@ -1,5 +1,5 @@ ---@diagnostic disable: no-unknown -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local exec_lua = t.exec_lua diff --git a/test/functional/plugin/lsp/diagnostic_spec.lua b/test/functional/plugin/lsp/diagnostic_spec.lua index ffff677ad6..27b0da1f3d 100644 --- a/test/functional/plugin/lsp/diagnostic_spec.lua +++ b/test/functional/plugin/lsp/diagnostic_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local t_lsp = require('test.functional.plugin.lsp.testutil') local clear = t.clear diff --git a/test/functional/plugin/lsp/handler_spec.lua b/test/functional/plugin/lsp/handler_spec.lua index 04e4fc8b8e..0ce7479c49 100644 --- a/test/functional/plugin/lsp/handler_spec.lua +++ b/test/functional/plugin/lsp/handler_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local exec_lua = t.exec_lua diff --git a/test/functional/plugin/lsp/incremental_sync_spec.lua b/test/functional/plugin/lsp/incremental_sync_spec.lua index eed182150e..a44b861ca1 100644 --- a/test/functional/plugin/lsp/incremental_sync_spec.lua +++ b/test/functional/plugin/lsp/incremental_sync_spec.lua @@ -1,5 +1,5 @@ -- Test suite for testing interactions with the incremental sync algorithms powering the LSP client -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api = t.api local clear = t.clear diff --git a/test/functional/plugin/lsp/inlay_hint_spec.lua b/test/functional/plugin/lsp/inlay_hint_spec.lua index dceaf45bca..64c65b74c3 100644 --- a/test/functional/plugin/lsp/inlay_hint_spec.lua +++ b/test/functional/plugin/lsp/inlay_hint_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local t_lsp = require('test.functional.plugin.lsp.testutil') local Screen = require('test.functional.ui.screen') diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua index 82450e404e..a9d8592eb0 100644 --- a/test/functional/plugin/lsp/semantic_tokens_spec.lua +++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local t_lsp = require('test.functional.plugin.lsp.testutil') local Screen = require('test.functional.ui.screen') diff --git a/test/functional/plugin/lsp/snippet_spec.lua b/test/functional/plugin/lsp/snippet_spec.lua index d62e188dab..0f4304868b 100644 --- a/test/functional/plugin/lsp/snippet_spec.lua +++ b/test/functional/plugin/lsp/snippet_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local snippet = require('vim.lsp._snippet_grammar') local type = snippet.NodeType diff --git a/test/functional/plugin/lsp/testutil.lua b/test/functional/plugin/lsp/testutil.lua index 7dc7bd9925..c51ccf3097 100644 --- a/test/functional/plugin/lsp/testutil.lua +++ b/test/functional/plugin/lsp/testutil.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(nil) +local t = require('test.functional.testutil')() local clear = t.clear local exec_lua = t.exec_lua diff --git a/test/functional/plugin/lsp/utils_spec.lua b/test/functional/plugin/lsp/utils_spec.lua index c7b874d443..8e57ace449 100644 --- a/test/functional/plugin/lsp/utils_spec.lua +++ b/test/functional/plugin/lsp/utils_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index a7dd0537c3..1ff29bf74f 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local t_lsp = require('test.functional.plugin.lsp.testutil') local assert_log = t.assert_log diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua index 862cb13146..19d279afbf 100644 --- a/test/functional/plugin/man_spec.lua +++ b/test/functional/plugin/man_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local command, feed = t.command, t.feed local clear = t.clear diff --git a/test/functional/plugin/matchparen_spec.lua b/test/functional/plugin/matchparen_spec.lua index 93d747519a..ae343b9555 100644 --- a/test/functional/plugin/matchparen_spec.lua +++ b/test/functional/plugin/matchparen_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/plugin/msgpack_spec.lua b/test/functional/plugin/msgpack_spec.lua index 76feca7911..9b70c12fc7 100644 --- a/test/functional/plugin/msgpack_spec.lua +++ b/test/functional/plugin/msgpack_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local api = t.api local eq = t.eq diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua index 9312f1f2f0..270eacc653 100644 --- a/test/functional/plugin/shada_spec.lua +++ b/test/functional/plugin/shada_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local eq, api, nvim_eval, nvim_command, exc_exec, fn, nvim_feed = diff --git a/test/functional/plugin/tohtml_spec.lua b/test/functional/plugin/tohtml_spec.lua index 9d947fe44a..f06d4d9c54 100644 --- a/test/functional/plugin/tohtml_spec.lua +++ b/test/functional/plugin/tohtml_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local exec = t.exec diff --git a/test/functional/plugin/tutor_spec.lua b/test/functional/plugin/tutor_spec.lua index d9ba8365d6..b8d5dc9399 100644 --- a/test/functional/plugin/tutor_spec.lua +++ b/test/functional/plugin/tutor_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command local feed = t.feed diff --git a/test/functional/plugin/vim_syntax_spec.lua b/test/functional/plugin/vim_syntax_spec.lua index c07c5646a6..d31d6ad2f2 100644 --- a/test/functional/plugin/vim_syntax_spec.lua +++ b/test/functional/plugin/vim_syntax_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/preload.lua b/test/functional/preload.lua index 8c3aff146d..24e528bc5b 100644 --- a/test/functional/preload.lua +++ b/test/functional/preload.lua @@ -1,9 +1,8 @@ -- Modules loaded here will NOT be cleared and reloaded by Busted. -- Busted started doing this to help provide more isolation. See issue #62 -- for more information about this. -local t = require('test.functional.testutil')(nil) +local t = require('test.functional.testutil')() require('test.functional.ui.screen') -local busted = require('busted') local is_os = t.is_os if is_os('win') then @@ -14,26 +13,3 @@ if is_os('win') then ]] ffi.C._set_fmode(0x8000) end - -local testid = (function() - local id = 0 - return function() - id = id + 1 - return id - end -end)() - --- Global before_each. https://github.com/Olivine-Labs/busted/issues/613 -local function before_each(_element, _parent) - local id = ('T%d'):format(testid()) - _G._nvim_test_id = id - return nil, true -end -busted.subscribe({ 'test', 'start' }, before_each, { - -- Ensure our --helper is handled before --output (see busted/runner.lua). - priority = 1, - -- Don't generate a test-id for skipped tests. /shrug - predicate = function(element, _, status) - return not (element.descriptor == 'pending' or status == 'pending') - end, -}) diff --git a/test/functional/provider/clipboard_spec.lua b/test/functional/provider/clipboard_spec.lua index b3af7e3e0f..3af52e8586 100644 --- a/test/functional/provider/clipboard_spec.lua +++ b/test/functional/provider/clipboard_spec.lua @@ -1,6 +1,6 @@ -- Test clipboard provider support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, insert = t.clear, t.feed, t.insert local feed_command, expect, eq, eval, source = t.feed_command, t.expect, t.eq, t.eval, t.source diff --git a/test/functional/provider/define_spec.lua b/test/functional/provider/define_spec.lua index 0de8458400..f0d47cae16 100644 --- a/test/functional/provider/define_spec.lua +++ b/test/functional/provider/define_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eval, command = t.eval, t.command local eq, run, stop = t.eq, t.run, t.stop local clear = t.clear @@ -28,7 +28,7 @@ local function runx(sync, handler, on_setup) local function setup_cb(...) on_setup(...) -- need to stop on setup callback because there's two session:request - -- calls in `request/t.lua`. The second call will always return + -- calls in `request/testutil.lua`. The second call will always return -- after pending notification/request callbacks are processed stop() end diff --git a/test/functional/provider/nodejs_spec.lua b/test/functional/provider/nodejs_spec.lua index beed71c120..1cf90bc0eb 100644 --- a/test/functional/provider/nodejs_spec.lua +++ b/test/functional/provider/nodejs_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, clear = t.eq, t.clear local missing_provider = t.missing_provider local command = t.command diff --git a/test/functional/provider/perl_spec.lua b/test/functional/provider/perl_spec.lua index b1293596a6..b5828aa9fc 100644 --- a/test/functional/provider/perl_spec.lua +++ b/test/functional/provider/perl_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, clear = t.eq, t.clear local missing_provider = t.missing_provider local command = t.command diff --git a/test/functional/provider/provider_spec.lua b/test/functional/provider/provider_spec.lua index e965aa5240..19668f91f0 100644 --- a/test/functional/provider/provider_spec.lua +++ b/test/functional/provider/provider_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval = t.clear, t.eval local command = t.command local eq = t.eq diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua index 5274054e7e..0b1440f43f 100644 --- a/test/functional/provider/python3_spec.lua +++ b/test/functional/provider/python3_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local eval, command, feed = t.eval, t.command, t.feed local eq, clear, insert = t.eq, t.clear, t.insert diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua index 1a1e264dea..bb8d5841c9 100644 --- a/test/functional/provider/ruby_spec.lua +++ b/test/functional/provider/ruby_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local clear = t.clear diff --git a/test/functional/script/luacats_grammar_spec.lua b/test/functional/script/luacats_grammar_spec.lua index 40a0f87594..c6f0f868f0 100644 --- a/test/functional/script/luacats_grammar_spec.lua +++ b/test/functional/script/luacats_grammar_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local grammar = require('scripts/luacats_grammar') diff --git a/test/functional/script/luacats_parser_spec.lua b/test/functional/script/luacats_parser_spec.lua index ae23fd2648..e797a913ba 100644 --- a/test/functional/script/luacats_parser_spec.lua +++ b/test/functional/script/luacats_parser_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local parser = require('scripts/luacats_parser') diff --git a/test/functional/script/text_utils_spec.lua b/test/functional/script/text_utils_spec.lua index 5e6ea0f2a5..7c608c157c 100644 --- a/test/functional/script/text_utils_spec.lua +++ b/test/functional/script/text_utils_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exec_lua = t.exec_lua local eq = t.eq diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua index dcc37d2f3d..ed918e37f4 100644 --- a/test/functional/shada/buffers_spec.lua +++ b/test/functional/shada/buffers_spec.lua @@ -1,5 +1,5 @@ -- shada buffer list saving/reading support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, fn, eq, api = t.command, t.fn, t.eq, t.api local expect_exit = t.expect_exit diff --git a/test/functional/shada/compatibility_spec.lua b/test/functional/shada/compatibility_spec.lua index 943024f463..b7f6bfb0b4 100644 --- a/test/functional/shada/compatibility_spec.lua +++ b/test/functional/shada/compatibility_spec.lua @@ -1,5 +1,5 @@ -- ShaDa compatibility support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, fn, eq = t.command, t.fn, t.eq local exc_exec = t.exc_exec diff --git a/test/functional/shada/errors_spec.lua b/test/functional/shada/errors_spec.lua index 1ad9eb70ea..736a6956af 100644 --- a/test/functional/shada/errors_spec.lua +++ b/test/functional/shada/errors_spec.lua @@ -1,5 +1,5 @@ -- ShaDa errors handling support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, eq, exc_exec = t.command, t.eq, t.exc_exec local t_shada = require('test.functional.shada.testutil') diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua index 9ebf18ccdf..521b7fb56f 100644 --- a/test/functional/shada/history_spec.lua +++ b/test/functional/shada/history_spec.lua @@ -1,5 +1,5 @@ -- ShaDa history saving/reading support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, fn, api, nvim_feed, eq = t.command, t.fn, t.api, t.feed, t.eq local assert_alive = t.assert_alive local expect_exit = t.expect_exit diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua index 7be6cc4d31..e6eefd4aed 100644 --- a/test/functional/shada/marks_spec.lua +++ b/test/functional/shada/marks_spec.lua @@ -1,5 +1,5 @@ -- ShaDa marks saving/reading support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api, nvim_command, fn, eq = t.api, t.command, t.fn, t.eq local feed = t.feed local exc_exec, exec_capture = t.exc_exec, t.exec_capture diff --git a/test/functional/shada/merging_spec.lua b/test/functional/shada/merging_spec.lua index 2ca481df07..57af4d5537 100644 --- a/test/functional/shada/merging_spec.lua +++ b/test/functional/shada/merging_spec.lua @@ -1,5 +1,5 @@ -- ShaDa merging data support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, fn, eq = t.command, t.fn, t.eq local exc_exec, exec_capture = t.exc_exec, t.exec_capture local api = t.api diff --git a/test/functional/shada/registers_spec.lua b/test/functional/shada/registers_spec.lua index b8faf6012f..e6636e9ece 100644 --- a/test/functional/shada/registers_spec.lua +++ b/test/functional/shada/registers_spec.lua @@ -1,5 +1,5 @@ -- ShaDa registers saving/reading support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local nvim_command, fn, eq = t.command, t.fn, t.eq local t_shada = require('test.functional.shada.testutil') diff --git a/test/functional/shada/shada_spec.lua b/test/functional/shada/shada_spec.lua index 938490aecb..8e677e2729 100644 --- a/test/functional/shada/shada_spec.lua +++ b/test/functional/shada/shada_spec.lua @@ -1,5 +1,5 @@ -- Other ShaDa tests -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api, nvim_command, fn, eq = t.api, t.command, t.fn, t.eq local write_file, spawn, set_session, nvim_prog, exc_exec = t.write_file, t.spawn, t.set_session, t.nvim_prog, t.exc_exec diff --git a/test/functional/shada/testutil.lua b/test/functional/shada/testutil.lua index 9cf81ec87b..286a7a8e21 100644 --- a/test/functional/shada/testutil.lua +++ b/test/functional/shada/testutil.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(nil) +local t = require('test.functional.testutil')() local api = t.api local write_file = t.write_file local concat_tables = t.concat_tables diff --git a/test/functional/shada/variables_spec.lua b/test/functional/shada/variables_spec.lua index 9c97d6a98f..19916ea466 100644 --- a/test/functional/shada/variables_spec.lua +++ b/test/functional/shada/variables_spec.lua @@ -1,5 +1,5 @@ -- ShaDa variables saving/reading support -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local api, fn, nvim_command, eq, eval = t.api, t.fn, t.command, t.eq, t.eval local expect_exit = t.expect_exit diff --git a/test/functional/terminal/altscreen_spec.lua b/test/functional/terminal/altscreen_spec.lua index 5b19ba0b65..6a4887356e 100644 --- a/test/functional/terminal/altscreen_spec.lua +++ b/test/functional/terminal/altscreen_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear, eq, api = t.clear, t.eq, t.api local feed = t.feed diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua index 9d1b9f10a2..f692335bfc 100644 --- a/test/functional/terminal/api_spec.lua +++ b/test/functional/terminal/api_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local ok = t.ok diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 341d6ee862..7cca620845 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local tt = require('test.functional.terminal.testutil') local assert_alive = t.assert_alive diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua index f8af320b27..c0b97fe414 100644 --- a/test/functional/terminal/channel_spec.lua +++ b/test/functional/terminal/channel_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local eq = t.eq diff --git a/test/functional/terminal/cursor_spec.lua b/test/functional/terminal/cursor_spec.lua index f722965108..a6084d8bd6 100644 --- a/test/functional/terminal/cursor_spec.lua +++ b/test/functional/terminal/cursor_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local tt = require('test.functional.terminal.testutil') local feed, clear = t.feed, t.clear diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 8642d3d988..224d43a50c 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local screen = require('test.functional.ui.screen') local testprg = t.testprg diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index d0cf65d69d..9a858c4764 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive local clear, poke_eventloop = t.clear, t.poke_eventloop diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua index 2c3ed4e97a..6fdfda82e6 100644 --- a/test/functional/terminal/highlight_spec.lua +++ b/test/functional/terminal/highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local tt = require('test.functional.terminal.testutil') local feed, clear = t.feed, t.clear diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua index 326cee51ce..d730c0523f 100644 --- a/test/functional/terminal/mouse_spec.lua +++ b/test/functional/terminal/mouse_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear, eq, eval = t.clear, t.eq, t.eval local feed, api, command = t.feed, t.api, t.command diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index ba135b827e..62277ce3ff 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local clear, eq = t.clear, t.eq local feed, testprg = t.feed, t.testprg diff --git a/test/functional/terminal/testutil.lua b/test/functional/terminal/testutil.lua index 878b3bf409..c5e5ed5e96 100644 --- a/test/functional/terminal/testutil.lua +++ b/test/functional/terminal/testutil.lua @@ -1,7 +1,7 @@ -- To test tui/input.c, this module spawns `nvim` inside :terminal and sends --- bytes via jobsend(). Note: the functional/t.lua test-session methods +-- bytes via jobsend(). Note: the functional/testutil.lua test-session methods -- operate on the _host_ session, _not_ the child session. -local t = require('test.functional.testutil')(nil) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local testprg = t.testprg local exec_lua = t.exec_lua diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index f172669a43..e4f26d85c8 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -4,7 +4,7 @@ -- "bracketed paste" terminal feature: -- http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 1ae240829a..1003ced189 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local feed_data = tt.feed_data local feed, clear = t.feed, t.clear diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua index a646aaf090..8ccdaf21cb 100644 --- a/test/functional/terminal/window_split_tab_spec.lua +++ b/test/functional/terminal/window_split_tab_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local assert_alive = t.assert_alive local clear = t.clear diff --git a/test/functional/testutil.lua b/test/functional/testutil.lua index e6d89eb302..9bf574f14d 100644 --- a/test/functional/testutil.lua +++ b/test/functional/testutil.lua @@ -1022,8 +1022,29 @@ function module.mkdir_p(path) return os.execute((is_os('win') and 'mkdir ' .. path or 'mkdir -p ' .. path)) end ---- @return test.functional.testutil -return function(after_each) +local testid = (function() + local id = 0 + return function() + id = id + 1 + return id + end +end)() + +return function() + local g = getfenv(2) + + --- @type function? + local before_each = g.before_each + --- @type function? + local after_each = g.after_each + + if before_each then + before_each(function() + local id = ('T%d'):format(testid()) + _G._nvim_test_id = id + end) + end + if after_each then after_each(function() check_logs() diff --git a/test/functional/treesitter/fold_spec.lua b/test/functional/treesitter/fold_spec.lua index b7bae0d17e..fc0996dd7f 100644 --- a/test/functional/treesitter/fold_spec.lua +++ b/test/functional/treesitter/fold_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local insert = t.insert diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua index 09f0c0bfcb..ecfe32db91 100644 --- a/test/functional/treesitter/highlight_spec.lua +++ b/test/functional/treesitter/highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear diff --git a/test/functional/treesitter/inspect_tree_spec.lua b/test/functional/treesitter/inspect_tree_spec.lua index 21b8123378..a2679b2059 100644 --- a/test/functional/treesitter/inspect_tree_spec.lua +++ b/test/functional/treesitter/inspect_tree_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local insert = t.insert local dedent = t.dedent diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua index 4473fa0265..365e2a697a 100644 --- a/test/functional/treesitter/language_spec.lua +++ b/test/functional/treesitter/language_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq @@ -120,6 +120,20 @@ describe('treesitter language API', function() eq('<node translation_unit>', exec_lua('return tostring(tree:root())')) end) + it('retrieve the tree given a range when range is out of bounds relative to buffer', function() + insert([[ + int main() { + int x = 3; + }]]) + + exec_lua([[ + langtree = vim.treesitter.get_parser(0, "c") + tree = langtree:tree_for_range({10, 10, 10, 10}) + ]]) + + eq('<node translation_unit>', exec_lua('return tostring(tree:root())')) + end) + it('retrieve the node given a range', function() insert([[ int main() { diff --git a/test/functional/treesitter/node_spec.lua b/test/functional/treesitter/node_spec.lua index 7c5c09e7ef..aaa7cee9d6 100644 --- a/test/functional/treesitter/node_spec.lua +++ b/test/functional/treesitter/node_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua index 8b2d1fd4aa..8b08f83ee6 100644 --- a/test/functional/treesitter/parser_spec.lua +++ b/test/functional/treesitter/parser_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local dedent = t.dedent diff --git a/test/functional/treesitter/query_spec.lua b/test/functional/treesitter/query_spec.lua index 0dd66fdba5..34f3734f2b 100644 --- a/test/functional/treesitter/query_spec.lua +++ b/test/functional/treesitter/query_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local dedent = t.dedent diff --git a/test/functional/treesitter/utils_spec.lua b/test/functional/treesitter/utils_spec.lua index c45d3ca047..1df8a098f9 100644 --- a/test/functional/treesitter/utils_spec.lua +++ b/test/functional/treesitter/utils_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local insert = t.insert diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua index e7f159437b..7ea7319cf8 100644 --- a/test/functional/ui/bufhl_spec.lua +++ b/test/functional/ui/bufhl_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, insert = t.clear, t.feed, t.insert diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua index 00c75c375f..ee8c713603 100644 --- a/test/functional/ui/cmdline_highlight_spec.lua +++ b/test/functional/ui/cmdline_highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index a3d44f3542..d3d5cb1093 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed = t.clear, t.feed local source = t.source diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index d4c23d45e2..9bfc8c6fb9 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, api = t.clear, t.api local eq = t.eq diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 924e4107db..66747057e7 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear @@ -667,6 +667,33 @@ describe('decorations providers', function() ]]) end) + it('on_line is invoked only for buffer lines', function() + insert(mulholland) + command('vnew') + insert(mulholland) + feed('dd') + command('windo diffthis') + + exec_lua([[ + out_of_bound = false + ]]) + setup_provider([[ + local function on_do(kind, _, bufnr, row) + if kind == 'line' then + if not api.nvim_buf_get_lines(bufnr, row, row + 1, false)[1] then + out_of_bound = true + end + end + end + ]]) + + feed('<C-e>') + + exec_lua([[ + assert(out_of_bound == false) + ]]) + end) + it('errors gracefully', function() insert(mulholland) diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua index 15b419c691..73fd7513c8 100644 --- a/test/functional/ui/diff_spec.lua +++ b/test/functional/ui/diff_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua index 49c808b5e6..934f00b288 100644 --- a/test/functional/ui/embed_spec.lua +++ b/test/functional/ui/embed_spec.lua @@ -1,6 +1,6 @@ local uv = vim.uv -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local api = t.api @@ -233,7 +233,7 @@ describe('--embed UI', function() } eq({ [16777215] = true }, seen) - -- NB: by accident how functional/t.lua currently handles the default color scheme, the + -- NB: by accident how functional/testutil.lua currently handles the default color scheme, the -- above is sufficient to test the behavior. But in case that workaround is removed, we need -- a test with an explicit override like below, so do it to remain safe. startup('--cmd', 'hi NORMAL guibg=#FF00FF') diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index eceb30039a..41b5b6ed2f 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local os = require('os') local clear, feed = t.clear, t.feed diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua index 6bf019746d..7e1cc546ae 100644 --- a/test/functional/ui/fold_spec.lua +++ b/test/functional/ui/fold_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, eq = t.clear, t.feed, t.eq local command = t.command diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index c6f1a680e6..bb17b1ec6c 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local os = require('os') local clear, feed, insert = t.clear, t.feed, t.insert diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua index bc380ecf91..03802fc1b2 100644 --- a/test/functional/ui/hlstate_spec.lua +++ b/test/functional/ui/hlstate_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, insert = t.clear, t.insert diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index 8e4e3cf597..6463814877 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/ui/inccommand_user_spec.lua b/test/functional/ui/inccommand_user_spec.lua index d08c16c1ad..6a11c8e9a7 100644 --- a/test/functional/ui/inccommand_user_spec.lua +++ b/test/functional/ui/inccommand_user_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local api = t.api local clear = t.clear diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua index 5d2ebb8c2e..8becaf918b 100644 --- a/test/functional/ui/input_spec.lua +++ b/test/functional/ui/input_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, feed_command = t.clear, t.feed_command local feed, next_msg, eq = t.feed, t.next_msg, t.eq local command = t.command diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua index c917b2c8f0..475f9c524b 100644 --- a/test/functional/ui/linematch_spec.lua +++ b/test/functional/ui/linematch_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed = t.feed diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index f66c7da4d9..867d487183 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed = t.clear, t.feed local eval = t.eval diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua index 8b27d26217..d301660b45 100644 --- a/test/functional/ui/mode_spec.lua +++ b/test/functional/ui/mode_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, insert = t.clear, t.feed, t.insert diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 41507e754d..a863b90549 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, api = t.clear, t.feed, t.api local insert, feed_command = t.insert, t.feed_command diff --git a/test/functional/ui/multibyte_spec.lua b/test/functional/ui/multibyte_spec.lua index 0f3e6e6b6c..5a6258ffd0 100644 --- a/test/functional/ui/multibyte_spec.lua +++ b/test/functional/ui/multibyte_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua index 20d3631930..3b2e2194bd 100644 --- a/test/functional/ui/multigrid_spec.lua +++ b/test/functional/ui/multigrid_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local feed, command, insert = t.feed, t.command, t.insert diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua index b1d10c28c4..e081cbefe3 100644 --- a/test/functional/ui/options_spec.lua +++ b/test/functional/ui/options_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index 627a13ee12..b09f1e0d03 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -1,5 +1,5 @@ local Screen = require('test.functional.ui.screen') -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local tt = require('test.functional.terminal.testutil') local assert_alive = t.assert_alive @@ -81,7 +81,7 @@ describe('shell command :!', function() {3:-- TERMINAL --} | ]], { - -- test/functional/t.lua defaults to background=light. + -- test/functional/testutil.lua defaults to background=light. [1] = { reverse = true }, [3] = { bold = true }, [10] = { foreground = 2 }, diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 9065e14c60..6ec098e8cd 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive local clear, feed = t.clear, t.feed diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua index d6c872b66e..1438d586e9 100644 --- a/test/functional/ui/quickfix_spec.lua +++ b/test/functional/ui/quickfix_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, api = t.clear, t.feed, t.api local insert, command = t.insert, t.command diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index b08a5b93a6..a9b3fb80d3 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -70,7 +70,7 @@ -- To help write screen tests, see Screen:snapshot_util(). -- To debug screen tests, see Screen:redraw_debug(). -local t = require('test.functional.testutil')(nil) +local t = require('test.functional.testutil')() local busted = require('busted') local deepcopy = vim.deepcopy local shallowcopy = t.shallowcopy diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 259baf725a..1bbe845bdd 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local spawn, set_session, clear = t.spawn, t.set_session, t.clear local feed, command = t.feed, t.command diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua index 592aea79c4..8a5529567b 100644 --- a/test/functional/ui/searchhl_spec.lua +++ b/test/functional/ui/searchhl_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, insert = t.clear, t.feed, t.insert local command = t.command diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index a1a21dece3..a2eb6124ee 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local api, clear, eq = t.api, t.clear, t.eq local eval, exec, feed = t.eval, t.exec, t.feed diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua index 4d960eb47c..a5952b5c05 100644 --- a/test/functional/ui/spell_spec.lua +++ b/test/functional/ui/spell_spec.lua @@ -1,6 +1,6 @@ -- Test for scenarios involving 'spell' -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local exec = t.exec diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua index 9d60e14bec..cf5126ad5c 100644 --- a/test/functional/ui/statuscolumn_spec.lua +++ b/test/functional/ui/statuscolumn_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua index d359efbee9..3c65cd46a9 100644 --- a/test/functional/ui/statusline_spec.lua +++ b/test/functional/ui/statusline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local assert_alive = t.assert_alive local clear = t.clear diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index c6109ad713..fea03ca6a3 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, command = t.clear, t.feed, t.command local eq = t.eq diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index dc9dc31295..db6b0d7f91 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, command, eq = t.clear, t.command, t.eq local insert = t.insert diff --git a/test/functional/ui/title_spec.lua b/test/functional/ui/title_spec.lua index bddf37d801..09c6372573 100644 --- a/test/functional/ui/title_spec.lua +++ b/test/functional/ui/title_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 228942e964..477db0fb9b 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear, feed, command = t.clear, t.feed, t.command local fn = t.fn diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index 02e7f1d3f3..f41abff88c 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local command = t.command diff --git a/test/functional/vimscript/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua index 10a98b646e..bb10db8cd3 100644 --- a/test/functional/vimscript/api_functions_spec.lua +++ b/test/functional/vimscript/api_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local neq, eq, command = t.neq, t.eq, t.command local clear = t.clear diff --git a/test/functional/vimscript/buf_functions_spec.lua b/test/functional/vimscript/buf_functions_spec.lua index 5cecafa370..4889db0cb7 100644 --- a/test/functional/vimscript/buf_functions_spec.lua +++ b/test/functional/vimscript/buf_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/vimscript/changedtick_spec.lua b/test/functional/vimscript/changedtick_spec.lua index 09aaea900b..ad8d42b4d5 100644 --- a/test/functional/vimscript/changedtick_spec.lua +++ b/test/functional/vimscript/changedtick_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval diff --git a/test/functional/vimscript/container_functions_spec.lua b/test/functional/vimscript/container_functions_spec.lua index c3acaa710f..a1bbee1e15 100644 --- a/test/functional/vimscript/container_functions_spec.lua +++ b/test/functional/vimscript/container_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval diff --git a/test/functional/vimscript/ctx_functions_spec.lua b/test/functional/vimscript/ctx_functions_spec.lua index c82ce350b3..956abe12e6 100644 --- a/test/functional/vimscript/ctx_functions_spec.lua +++ b/test/functional/vimscript/ctx_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local call = t.call local clear = t.clear diff --git a/test/functional/vimscript/environ_spec.lua b/test/functional/vimscript/environ_spec.lua index b4c7b30421..9ef0edd815 100644 --- a/test/functional/vimscript/environ_spec.lua +++ b/test/functional/vimscript/environ_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local environ = t.fn.environ diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua index 5fcdc65de1..4e473b9e44 100644 --- a/test/functional/vimscript/errorlist_spec.lua +++ b/test/functional/vimscript/errorlist_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local command = t.command diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua index 0918c5957a..b7c0803ef7 100644 --- a/test/functional/vimscript/eval_spec.lua +++ b/test/functional/vimscript/eval_spec.lua @@ -9,7 +9,7 @@ -- test/functional/vimscript/<funcname>_spec.lua -- test/functional/vimscript/functions_spec.lua -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local mkdir = t.mkdir diff --git a/test/functional/vimscript/executable_spec.lua b/test/functional/vimscript/executable_spec.lua index de16563eed..75d36c26d9 100644 --- a/test/functional/vimscript/executable_spec.lua +++ b/test/functional/vimscript/executable_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, clear, call, write_file, command = t.eq, t.clear, t.call, t.write_file, t.command local exc_exec = t.exc_exec local eval = t.eval diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index b765f50fe4..32477323a1 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval local clear = t.clear diff --git a/test/functional/vimscript/exepath_spec.lua b/test/functional/vimscript/exepath_spec.lua index 57242a2483..a1a2afb4ed 100644 --- a/test/functional/vimscript/exepath_spec.lua +++ b/test/functional/vimscript/exepath_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq, clear, call = t.eq, t.clear, t.call local command = t.command local exc_exec = t.exc_exec diff --git a/test/functional/vimscript/fnamemodify_spec.lua b/test/functional/vimscript/fnamemodify_spec.lua index 0706a60f57..fd2c79d9a5 100644 --- a/test/functional/vimscript/fnamemodify_spec.lua +++ b/test/functional/vimscript/fnamemodify_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local fnamemodify = t.fn.fnamemodify diff --git a/test/functional/vimscript/functions_spec.lua b/test/functional/vimscript/functions_spec.lua index cb4d329ae9..1d57b60b95 100644 --- a/test/functional/vimscript/functions_spec.lua +++ b/test/functional/vimscript/functions_spec.lua @@ -5,7 +5,7 @@ -- -- Core "eval" tests live in eval_spec.lua. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eval = t.eval diff --git a/test/functional/vimscript/getline_spec.lua b/test/functional/vimscript/getline_spec.lua index 600730c010..18f7eabc25 100644 --- a/test/functional/vimscript/getline_spec.lua +++ b/test/functional/vimscript/getline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local call = t.call local clear = t.clear diff --git a/test/functional/vimscript/glob_spec.lua b/test/functional/vimscript/glob_spec.lua index 708b976dbb..c66865611f 100644 --- a/test/functional/vimscript/glob_spec.lua +++ b/test/functional/vimscript/glob_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, command, eval, eq = t.clear, t.command, t.eval, t.eq local mkdir = t.mkdir diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua index 08193f8d02..05d5b04a29 100644 --- a/test/functional/vimscript/has_spec.lua +++ b/test/functional/vimscript/has_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local clear = t.clear local connect = t.connect diff --git a/test/functional/vimscript/hostname_spec.lua b/test/functional/vimscript/hostname_spec.lua index 024997f6b0..e5be1cf4c3 100644 --- a/test/functional/vimscript/hostname_spec.lua +++ b/test/functional/vimscript/hostname_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local ok = t.ok local call = t.call diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index 0ac22c7320..e974d71356 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/vimscript/json_functions_spec.lua b/test/functional/vimscript/json_functions_spec.lua index e4a9c41d59..f17cf7017c 100644 --- a/test/functional/vimscript/json_functions_spec.lua +++ b/test/functional/vimscript/json_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local fn = t.fn local api = t.api diff --git a/test/functional/vimscript/lang_spec.lua b/test/functional/vimscript/lang_spec.lua index cad3df9aef..bb6b3ea5a7 100644 --- a/test/functional/vimscript/lang_spec.lua +++ b/test/functional/vimscript/lang_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval, eq = t.clear, t.eval, t.eq local exc_exec, source = t.exc_exec, t.source diff --git a/test/functional/vimscript/let_spec.lua b/test/functional/vimscript/let_spec.lua index bcfd12cbe8..f8b9ba89d0 100644 --- a/test/functional/vimscript/let_spec.lua +++ b/test/functional/vimscript/let_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/vimscript/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua index fba3a627e9..7bf835102c 100644 --- a/test/functional/vimscript/map_functions_spec.lua +++ b/test/functional/vimscript/map_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/vimscript/match_functions_spec.lua b/test/functional/vimscript/match_functions_spec.lua index 2bff221c0b..98a2169676 100644 --- a/test/functional/vimscript/match_functions_spec.lua +++ b/test/functional/vimscript/match_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq diff --git a/test/functional/vimscript/minmax_functions_spec.lua b/test/functional/vimscript/minmax_functions_spec.lua index dbdfc06afb..1748c97849 100644 --- a/test/functional/vimscript/minmax_functions_spec.lua +++ b/test/functional/vimscript/minmax_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval diff --git a/test/functional/vimscript/modeline_spec.lua b/test/functional/vimscript/modeline_spec.lua index fde6dbef30..7dfaba217b 100644 --- a/test/functional/vimscript/modeline_spec.lua +++ b/test/functional/vimscript/modeline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local clear, command, write_file = t.clear, t.command, t.write_file diff --git a/test/functional/vimscript/msgpack_functions_spec.lua b/test/functional/vimscript/msgpack_functions_spec.lua index 55540712d7..c945efab5a 100644 --- a/test/functional/vimscript/msgpack_functions_spec.lua +++ b/test/functional/vimscript/msgpack_functions_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local fn = t.fn local eval, eq = t.eval, t.eq diff --git a/test/functional/vimscript/null_spec.lua b/test/functional/vimscript/null_spec.lua index 99abc9bcf4..fc051371ba 100644 --- a/test/functional/vimscript/null_spec.lua +++ b/test/functional/vimscript/null_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exc_exec = t.exc_exec local command = t.command diff --git a/test/functional/vimscript/operators_spec.lua b/test/functional/vimscript/operators_spec.lua index e3357d1dfd..b6294f1f5a 100644 --- a/test/functional/vimscript/operators_spec.lua +++ b/test/functional/vimscript/operators_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local eval = t.eval local clear = t.clear diff --git a/test/functional/vimscript/printf_spec.lua b/test/functional/vimscript/printf_spec.lua index 365c10119a..027edd3b3a 100644 --- a/test/functional/vimscript/printf_spec.lua +++ b/test/functional/vimscript/printf_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq diff --git a/test/functional/vimscript/reltime_spec.lua b/test/functional/vimscript/reltime_spec.lua index 22c0bd5bb9..4d77c911e4 100644 --- a/test/functional/vimscript/reltime_spec.lua +++ b/test/functional/vimscript/reltime_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, ok = t.clear, t.eq, t.ok local neq, command, fn = t.neq, t.command, t.fn local matches = t.matches diff --git a/test/functional/vimscript/screenchar_spec.lua b/test/functional/vimscript/screenchar_spec.lua index 08341193e0..442d7904a0 100644 --- a/test/functional/vimscript/screenchar_spec.lua +++ b/test/functional/vimscript/screenchar_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, neq = t.clear, t.eq, t.neq local command, api, fn = t.command, t.api, t.fn local tbl_deep_extend = vim.tbl_deep_extend diff --git a/test/functional/vimscript/screenpos_spec.lua b/test/functional/vimscript/screenpos_spec.lua index 8c43a12810..057e740205 100644 --- a/test/functional/vimscript/screenpos_spec.lua +++ b/test/functional/vimscript/screenpos_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eq, api = t.clear, t.eq, t.api local command, fn = t.command, t.fn local feed = t.feed diff --git a/test/functional/vimscript/server_spec.lua b/test/functional/vimscript/server_spec.lua index 9b2c2eaf65..a079429730 100644 --- a/test/functional/vimscript/server_spec.lua +++ b/test/functional/vimscript/server_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_log = t.assert_log local eq, neq, eval = t.eq, t.neq, t.eval local clear, fn, api = t.clear, t.fn, t.api diff --git a/test/functional/vimscript/setpos_spec.lua b/test/functional/vimscript/setpos_spec.lua index 6398aba79d..16a974c511 100644 --- a/test/functional/vimscript/setpos_spec.lua +++ b/test/functional/vimscript/setpos_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local setpos = t.fn.setpos local getpos = t.fn.getpos local insert = t.insert diff --git a/test/functional/vimscript/sort_spec.lua b/test/functional/vimscript/sort_spec.lua index b1fa88e329..539b74984c 100644 --- a/test/functional/vimscript/sort_spec.lua +++ b/test/functional/vimscript/sort_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local NIL = vim.NIL diff --git a/test/functional/vimscript/special_vars_spec.lua b/test/functional/vimscript/special_vars_spec.lua index 79ec76f622..0ce8703735 100644 --- a/test/functional/vimscript/special_vars_spec.lua +++ b/test/functional/vimscript/special_vars_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local exc_exec = t.exc_exec local command = t.command local fn = t.fn diff --git a/test/functional/vimscript/state_spec.lua b/test/functional/vimscript/state_spec.lua index f5f9b829f8..4a340f9717 100644 --- a/test/functional/vimscript/state_spec.lua +++ b/test/functional/vimscript/state_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local exec = t.exec diff --git a/test/functional/vimscript/string_spec.lua b/test/functional/vimscript/string_spec.lua index 859757c93c..c57e4e978b 100644 --- a/test/functional/vimscript/string_spec.lua +++ b/test/functional/vimscript/string_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear = t.clear local eq = t.eq local command = t.command diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index 1cbe9422e2..77ba4e8f97 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -1,6 +1,6 @@ -- Tests for system() and :! shell. -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local assert_alive = t.assert_alive local testprg = t.testprg diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index 2ec951448c..6cd8590500 100644 --- a/test/functional/vimscript/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local feed, eq, eval, ok = t.feed, t.eq, t.eval, t.ok local source, async_meths, run = t.source, t.async_meths, t.run diff --git a/test/functional/vimscript/uniq_spec.lua b/test/functional/vimscript/uniq_spec.lua index ed87d50abf..6ef6dd9960 100644 --- a/test/functional/vimscript/uniq_spec.lua +++ b/test/functional/vimscript/uniq_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local eq = t.eq local clear = t.clear diff --git a/test/functional/vimscript/vvar_event_spec.lua b/test/functional/vimscript/vvar_event_spec.lua index 57c849b45a..e8b8ff36c0 100644 --- a/test/functional/vimscript/vvar_event_spec.lua +++ b/test/functional/vimscript/vvar_event_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local clear, eval, eq = t.clear, t.eval, t.eq local command = t.command describe('v:event', function() diff --git a/test/functional/vimscript/wait_spec.lua b/test/functional/vimscript/wait_spec.lua index 15e04af6c9..81c406d0cc 100644 --- a/test/functional/vimscript/wait_spec.lua +++ b/test/functional/vimscript/wait_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local call = t.call local clear = t.clear local command = t.command diff --git a/test/functional/vimscript/writefile_spec.lua b/test/functional/vimscript/writefile_spec.lua index 47fbd2ef1b..6ad527d922 100644 --- a/test/functional/vimscript/writefile_spec.lua +++ b/test/functional/vimscript/writefile_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local mkdir = t.mkdir local clear = t.clear diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index a8d781fefb..17414e1d3b 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -108,7 +108,7 @@ func s:GetFilenameChecks() abort \ 'asterisk': ['asterisk/file.conf', 'asterisk/file.conf-file', 'some-asterisk/file.conf', 'some-asterisk/file.conf-file'], \ 'astro': ['file.astro'], \ 'atlas': ['file.atl', 'file.as'], - \ 'authzed': ['file.zed'], + \ 'authzed': ['schema.zed'], \ 'autohotkey': ['file.ahk'], \ 'autoit': ['file.au3'], \ 'automake': ['GNUmakefile.am', 'makefile.am', 'Makefile.am'], @@ -127,6 +127,7 @@ func s:GetFilenameChecks() abort \ 'blade': ['file.blade.php'], \ 'blank': ['file.bl'], \ 'blueprint': ['file.blp'], + \ 'bp': ['Android.bp'], \ 'bsdl': ['file.bsd', 'file.bsdl'], \ 'bst': ['file.bst'], \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE', 'WORKSPACE.bzlmod'], @@ -145,6 +146,7 @@ func s:GetFilenameChecks() abort \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], \ 'cfengine': ['cfengine.conf'], \ 'cfg': ['file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'], + \ 'cgdbrc': ['cgdbrc'], \ 'ch': ['file.chf'], \ 'chaiscript': ['file.chai'], \ 'chaskell': ['file.chs'], @@ -161,7 +163,7 @@ func s:GetFilenameChecks() abort \ 'cobol': ['file.cbl', 'file.cob', 'file.lib'], \ 'coco': ['file.atg'], \ 'conaryrecipe': ['file.recipe'], - \ 'conf': ['auto.master', 'file.conf'], + \ 'conf': ['auto.master', 'file.conf', 'texdoc.cnf', '.x11vncrc'], \ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file', 'any/etc/hostname.file'], \ 'confini': ['/etc/pacman.conf', 'any/etc/pacman.conf', 'mpv.conf', 'any/.aws/config', 'any/.aws/credentials', 'file.nmconnection'], \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], @@ -211,7 +213,7 @@ func s:GetFilenameChecks() abort \ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'], \ 'dockerfile': ['Containerfile', 'Dockerfile', 'dockerfile', 'file.Dockerfile', 'file.dockerfile', 'Dockerfile.debian', 'Containerfile.something'], \ 'dosbatch': ['file.bat'], - \ 'dosini': ['/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap', 'file.vbp', 'ja2.ini', 'JA2.INI', 'setup.cfg', 'pudb.cfg', '.coveragerc'], + \ 'dosini': ['/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file', 'file.wrap', 'file.vbp', 'ja2.ini', 'JA2.INI', 'mimeapps.list', 'pip.conf', 'setup.cfg', 'pudb.cfg', '.coveragerc', 'psprint.conf', 'sofficerc', 'any/.config/lxqt/globalkeyshortcuts.conf', 'any/.config/screengrab/screengrab.conf'], \ 'dot': ['file.dot', 'file.gv'], \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'], \ 'dtd': ['file.dtd'], @@ -344,7 +346,7 @@ func s:GetFilenameChecks() abort \ 'janet': ['file.janet'], \ 'java': ['file.java', 'file.jav'], \ 'javacc': ['file.jj', 'file.jjt'], - \ 'javascript': ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'], + \ 'javascript': ['file.js', 'file.jsm', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs', '.node_repl_history'], \ 'javascript.glimmer': ['file.gjs'], \ 'javascriptreact': ['file.jsx'], \ 'jess': ['file.clp'], @@ -352,7 +354,7 @@ func s:GetFilenameChecks() abort \ 'jq': ['file.jq'], \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'], - \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace'], + \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci'], \ 'json5': ['file.json5'], \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'], \ 'jsonl': ['file.jsonl'], @@ -398,13 +400,13 @@ func s:GetFilenameChecks() abort \ 'lpc': ['file.lpc', 'file.ulpc'], \ 'lsl': ['file.lsl'], \ 'lss': ['file.lss'], - \ 'lua': ['file.lua', 'file.tlu', 'file.rockspec', 'file.nse', '.luacheckrc', '.busted', 'rock_manifest', 'config.ld'], + \ 'lua': ['file.lua', 'file.tlu', 'file.rockspec', 'file.nse', '.lua_history', '.luacheckrc', '.busted', 'rock_manifest', 'config.ld'], \ 'luau': ['file.luau'], \ 'lynx': ['lynx.cfg'], \ 'lyrics': ['file.lrc'], \ 'm3build': ['m3makefile', 'm3overrides'], \ 'm3quake': ['file.quake', 'cm3.cfg'], - \ 'm4': ['file.at'], + \ 'm4': ['file.at', '.m4_history'], \ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml', 'reportbug-file'], \ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases', 'any/etc/aliases', 'any/etc/mail/aliases'], \ 'mailcap': ['.mailcap', 'mailcap'], @@ -423,13 +425,32 @@ func s:GetFilenameChecks() abort \ 'mel': ['file.mel'], \ 'mermaid': ['file.mmd', 'file.mmdc', 'file.mermaid'], \ 'meson': ['meson.build', 'meson.options', 'meson_options.txt'], - \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user', - \ '/log/auth.log', '/log/cron.log', '/log/daemon.log', '/log/debug.log', '/log/kern.log', '/log/lpr.log', '/log/mail.log', '/log/messages.log', '/log/news/news.log', '/log/syslog.log', '/log/user.log', - \ '/log/auth.err', '/log/cron.err', '/log/daemon.err', '/log/debug.err', '/log/kern.err', '/log/lpr.err', '/log/mail.err', '/log/messages.err', '/log/news/news.err', '/log/syslog.err', '/log/user.err', - \ '/log/auth.info', '/log/cron.info', '/log/daemon.info', '/log/debug.info', '/log/kern.info', '/log/lpr.info', '/log/mail.info', '/log/messages.info', '/log/news/news.info', '/log/syslog.info', '/log/user.info', - \ '/log/auth.warn', '/log/cron.warn', '/log/daemon.warn', '/log/debug.warn', '/log/kern.warn', '/log/lpr.warn', '/log/mail.warn', '/log/messages.warn', '/log/news/news.warn', '/log/syslog.warn', '/log/user.warn', - \ '/log/auth.crit', '/log/cron.crit', '/log/daemon.crit', '/log/debug.crit', '/log/kern.crit', '/log/lpr.crit', '/log/mail.crit', '/log/messages.crit', '/log/news/news.crit', '/log/syslog.crit', '/log/user.crit', - \ '/log/auth.notice', '/log/cron.notice', '/log/daemon.notice', '/log/debug.notice', '/log/kern.notice', '/log/lpr.notice', '/log/mail.notice', '/log/messages.notice', '/log/news/news.notice', '/log/syslog.notice', '/log/user.notice'], + \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', + \ '/log/kern', '/log/lpr', '/log/mail', '/log/messages', + \ '/log/news/news', '/log/syslog', '/log/user', '/log/auth.log', + \ '/log/cron.log', '/log/daemon.log', '/log/debug.log', + \ '/log/kern.log', '/log/lpr.log', '/log/mail.log', + \ '/log/messages.log', '/log/news/news.log', '/log/syslog.log', + \ '/log/user.log', '/log/auth.err', '/log/cron.err', + \ '/log/daemon.err', '/log/debug.err', '/log/kern.err', + \ '/log/lpr.err', '/log/mail.err', '/log/messages.err', + \ '/log/news/news.err', '/log/syslog.err', '/log/user.err', + \ '/log/auth.info', '/log/cron.info', '/log/daemon.info', + \ '/log/debug.info', '/log/kern.info', '/log/lpr.info', + \ '/log/mail.info', '/log/messages.info', '/log/news/news.info', + \ '/log/syslog.info', '/log/user.info', '/log/auth.warn', + \ '/log/cron.warn', '/log/daemon.warn', '/log/debug.warn', + \ '/log/kern.warn', '/log/lpr.warn', '/log/mail.warn', + \ '/log/messages.warn', '/log/news/news.warn', + \ '/log/syslog.warn', '/log/user.warn', '/log/auth.crit', + \ '/log/cron.crit', '/log/daemon.crit', '/log/debug.crit', + \ '/log/kern.crit', '/log/lpr.crit', '/log/mail.crit', + \ '/log/messages.crit', '/log/news/news.crit', + \ '/log/syslog.crit', '/log/user.crit', '/log/auth.notice', + \ '/log/cron.notice', '/log/daemon.notice', '/log/debug.notice', + \ '/log/kern.notice', '/log/lpr.notice', '/log/mail.notice', + \ '/log/messages.notice', '/log/news/news.notice', + \ '/log/syslog.notice', '/log/user.notice'], \ 'mf': ['file.mf'], \ 'mgl': ['file.mgl'], \ 'mgp': ['file.mgp'], @@ -452,7 +473,18 @@ func s:GetFilenameChecks() abort \ 'mupad': ['file.mu'], \ 'mush': ['file.mush'], \ 'mustache': ['file.mustache'], - \ 'muttrc': ['Muttngrc', 'Muttrc', '.muttngrc', '.muttngrc-file', '.muttrc', '.muttrc-file', '/.mutt/muttngrc', '/.mutt/muttngrc-file', '/.mutt/muttrc', '/.mutt/muttrc-file', '/.muttng/muttngrc', '/.muttng/muttngrc-file', '/.muttng/muttrc', '/.muttng/muttrc-file', '/etc/Muttrc.d/file', '/etc/Muttrc.d/file.rc', 'Muttngrc-file', 'Muttrc-file', 'any/.mutt/muttngrc', 'any/.mutt/muttngrc-file', 'any/.mutt/muttrc', 'any/.mutt/muttrc-file', 'any/.muttng/muttngrc', 'any/.muttng/muttngrc-file', 'any/.muttng/muttrc', 'any/.muttng/muttrc-file', 'any/etc/Muttrc.d/file', 'muttngrc', 'muttngrc-file', 'muttrc', 'muttrc-file'], + \ 'muttrc': ['Muttngrc', 'Muttrc', '.muttngrc', '.muttngrc-file', '.muttrc', + \ '.muttrc-file', '/.mutt/muttngrc', '/.mutt/muttngrc-file', + \ '/.mutt/muttrc', '/.mutt/muttrc-file', '/.muttng/muttngrc', + \ '/.muttng/muttngrc-file', '/.muttng/muttrc', + \ '/.muttng/muttrc-file', '/etc/Muttrc.d/file', + \ '/etc/Muttrc.d/file.rc', 'Muttngrc-file', 'Muttrc-file', + \ 'any/.mutt/muttngrc', 'any/.mutt/muttngrc-file', + \ 'any/.mutt/muttrc', 'any/.mutt/muttrc-file', + \ 'any/.muttng/muttngrc', 'any/.muttng/muttngrc-file', + \ 'any/.muttng/muttrc', 'any/.muttng/muttrc-file', + \ 'any/etc/Muttrc.d/file', 'muttngrc', 'muttngrc-file', 'muttrc', + \ 'muttrc-file'], \ 'mysql': ['file.mysql', '.mysql_history'], \ 'n1ql': ['file.n1ql', 'file.nql'], \ 'named': ['namedfile.conf', 'rndcfile.conf', 'named-file.conf', 'named.conf', 'rndc-file.conf', 'rndc-file.key', 'rndc.conf', 'rndc.key'], @@ -492,7 +524,7 @@ func s:GetFilenameChecks() abort \ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'], \ 'pascal': ['file.pas', 'file.dpr', 'file.lpr'], \ 'passwd': ['any/etc/passwd', 'any/etc/passwd-', 'any/etc/passwd.edit', 'any/etc/shadow', 'any/etc/shadow-', 'any/etc/shadow.edit', 'any/var/backups/passwd.bak', 'any/var/backups/shadow.bak', '/etc/passwd', '/etc/passwd-', '/etc/passwd.edit', '/etc/shadow', '/etc/shadow-', '/etc/shadow.edit', '/var/backups/passwd.bak', '/var/backups/shadow.bak'], - \ 'pbtxt': ['file.pbtxt'], + \ 'pbtxt': ['file.txtpb', 'file.textproto', 'file.textpb', 'file.pbtxt'], \ 'pccts': ['file.g'], \ 'pcmk': ['file.pcmk'], \ 'pdf': ['file.pdf'], @@ -536,7 +568,7 @@ func s:GetFilenameChecks() abort \ 'pymanifest': ['MANIFEST.in'], \ 'pyret': ['file.arr'], \ 'pyrex': ['file.pyx', 'file.pxd'], - \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'], + \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', '.python_history', '.jline-jython.history', 'file.ptl', 'file.pyi', 'SConstruct'], \ 'ql': ['file.ql', 'file.qll'], \ 'qml': ['file.qml', 'file.qbs'], \ 'qmldir': ['qmldir'], @@ -576,7 +608,7 @@ func s:GetFilenameChecks() abort \ 'rrst': ['file.rrst', 'file.srst'], \ 'rst': ['file.rst'], \ 'rtf': ['file.rtf'], - \ 'ruby': ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], + \ 'ruby': ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], \ 'rust': ['file.rs'], \ 'samba': ['smb.conf'], \ 'sas': ['file.sas'], @@ -596,7 +628,7 @@ func s:GetFilenameChecks() abort \ 'services': ['/etc/services', 'any/etc/services'], \ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'], \ 'sexplib': ['file.sexp'], - \ 'sh': ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats'], + \ 'sh': ['.bashrc', '.bash_profile', '.bash-profile', '.bash_logout', '.bash-logout', '.bash_aliases', '.bash-aliases', '.bash_history', '.bash-history', '/tmp/bash-fc-3Ozjlw', '/tmp/bash-fc.3Ozjlw', 'PKGBUILD', 'APKBUILD', 'file.bash', '/usr/share/doc/bash-completion/filter.sh', '/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf', 'file.bats', '.ash_history'], \ 'sieve': ['file.siv', 'file.sieve'], \ 'sil': ['file.sil'], \ 'simula': ['file.sim'], @@ -627,7 +659,7 @@ func s:GetFilenameChecks() abort \ 'spice': ['file.sp', 'file.spice'], \ 'spup': ['file.speedup', 'file.spdata', 'file.spd'], \ 'spyce': ['file.spy', 'file.spi'], - \ 'sql': ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks'], + \ 'sql': ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks', '.sqlite_history'], \ 'sqlj': ['file.sqlj'], \ 'prql': ['file.prql'], \ 'sqr': ['file.sqr', 'file.sqi'], @@ -653,7 +685,45 @@ func s:GetFilenameChecks() abort \ 'swiftgyb': ['file.swift.gyb'], \ 'swig': ['file.swg', 'file.swig'], \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'], - \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.dnssd', 'any/systemd/file.link', 'any/systemd/file.mount', 'any/systemd/file.netdev', 'any/systemd/file.network', 'any/systemd/file.nspawn', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.slice', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer', '/etc/systemd/some.conf.d/file.conf', '/etc/systemd/system/some.d/file.conf', '/etc/systemd/system/some.d/.#file', '/etc/systemd/system/.#otherfile', '/home/user/.config/systemd/user/some.d/mine.conf', '/home/user/.config/systemd/user/some.d/.#file', '/home/user/.config/systemd/user/.#otherfile', '/.config/systemd/user/.#', '/.config/systemd/user/.#-file', '/.config/systemd/user/file.d/.#', '/.config/systemd/user/file.d/.#-file', '/.config/systemd/user/file.d/file.conf', '/etc/systemd/file.conf.d/file.conf', '/etc/systemd/system/.#', '/etc/systemd/system/.#-file', '/etc/systemd/system/file.d/.#', '/etc/systemd/system/file.d/.#-file', '/etc/systemd/system/file.d/file.conf', '/systemd/file.automount', '/systemd/file.dnssd', '/systemd/file.link', '/systemd/file.mount', '/systemd/file.netdev', '/systemd/file.network', '/systemd/file.nspawn', '/systemd/file.path', '/systemd/file.service', '/systemd/file.slice', '/systemd/file.socket', '/systemd/file.swap', '/systemd/file.target', '/systemd/file.timer', 'any/.config/systemd/user/.#', 'any/.config/systemd/user/.#-file', 'any/.config/systemd/user/file.d/.#', 'any/.config/systemd/user/file.d/.#-file', 'any/.config/systemd/user/file.d/file.conf', 'any/etc/systemd/file.conf.d/file.conf', 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file', 'any/etc/systemd/system/file.d/.#', 'any/etc/systemd/system/file.d/.#-file', 'any/etc/systemd/system/file.d/file.conf'], + \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.dnssd', + \ 'any/systemd/file.link', 'any/systemd/file.mount', + \ 'any/systemd/file.netdev', 'any/systemd/file.network', + \ 'any/systemd/file.nspawn', 'any/systemd/file.path', + \ 'any/systemd/file.service', 'any/systemd/file.slice', + \ 'any/systemd/file.socket', 'any/systemd/file.swap', + \ 'any/systemd/file.target', 'any/systemd/file.timer', + \ '/etc/systemd/some.conf.d/file.conf', + \ '/etc/systemd/system/some.d/file.conf', + \ '/etc/systemd/system/some.d/.#file', + \ '/etc/systemd/system/.#otherfile', + \ '/home/user/.config/systemd/user/some.d/mine.conf', + \ '/home/user/.config/systemd/user/some.d/.#file', + \ '/home/user/.config/systemd/user/.#otherfile', + \ '/.config/systemd/user/.#', '/.config/systemd/user/.#-file', + \ '/.config/systemd/user/file.d/.#', + \ '/.config/systemd/user/file.d/.#-file', + \ '/.config/systemd/user/file.d/file.conf', + \ '/etc/systemd/file.conf.d/file.conf', '/etc/systemd/system/.#', + \ '/etc/systemd/system/.#-file', '/etc/systemd/system/file.d/.#', + \ '/etc/systemd/system/file.d/.#-file', + \ '/etc/systemd/system/file.d/file.conf', + \ '/systemd/file.automount', '/systemd/file.dnssd', + \ '/systemd/file.link', '/systemd/file.mount', + \ '/systemd/file.netdev', '/systemd/file.network', + \ '/systemd/file.nspawn', '/systemd/file.path', + \ '/systemd/file.service', '/systemd/file.slice', + \ '/systemd/file.socket', '/systemd/file.swap', + \ '/systemd/file.target', '/systemd/file.timer', + \ 'any/.config/systemd/user/.#', + \ 'any/.config/systemd/user/.#-file', + \ 'any/.config/systemd/user/file.d/.#', + \ 'any/.config/systemd/user/file.d/.#-file', + \ 'any/.config/systemd/user/file.d/file.conf', + \ 'any/etc/systemd/file.conf.d/file.conf', + \ 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file', + \ 'any/etc/systemd/system/file.d/.#', + \ 'any/etc/systemd/system/file.d/.#-file', + \ 'any/etc/systemd/system/file.d/file.conf'], \ 'systemverilog': ['file.sv', 'file.svh'], \ 'trace32': ['file.cmm', 'file.t32'], \ 'tags': ['tags'], @@ -661,14 +731,14 @@ func s:GetFilenameChecks() abort \ 'tal': ['file.tal'], \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'], \ 'taskedit': ['file.task'], - \ 'tcl': ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc'], + \ 'tcl': ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc', '.tclsh-history', '.xsctcmdhistory', '.xsdbcmdhistory'], \ 'tablegen': ['file.td'], \ 'teal': ['file.tl'], \ 'template': ['file.tmpl'], \ 'teraterm': ['file.ttl'], \ 'terminfo': ['file.ti'], \ 'terraform-vars': ['file.tfvars'], - \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'], + \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl', 'any/.texlive/texmf-config/tex/latex/file/file.cfg', 'file.pgf', 'file.nlo', 'file.nls', 'file.out', 'file.thm', 'file.eps_tex', 'file.pygtex', 'file.pygstyle', 'file.clo', 'file.aux', 'file.brf', 'file.ind', 'file.lof', 'file.loe', 'file.nav', 'file.vrb', 'file.ins', 'file.tikz', 'file.bbx', 'file.cbx', 'file.beamer'], \ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'], \ 'texmf': ['texmf.cnf'], \ 'text': ['file.text', 'file.txt', 'README', 'LICENSE', 'COPYING', 'AUTHORS', '/usr/share/doc/bash-completion/AUTHORS', '/etc/apt/apt.conf.d/README', '/etc/Muttrc.d/README'], @@ -689,7 +759,7 @@ func s:GetFilenameChecks() abort \ 'tssop': ['file.tssop'], \ 'tsv': ['file.tsv'], \ 'twig': ['file.twig'], - \ 'typescript': ['file.mts', 'file.cts'], + \ 'typescript': ['file.mts', 'file.cts', '.ts_node_repl_history'], \ 'typescript.glimmer': ['file.gts'], \ 'typescriptreact': ['file.tsx'], \ 'typespec': ['file.tsp'], @@ -748,7 +818,7 @@ func s:GetFilenameChecks() abort \ 'xinetd': ['/etc/xinetd.conf', '/etc/xinetd.d/file', 'any/etc/xinetd.conf', 'any/etc/xinetd.d/file'], \ 'xkb': ['/usr/share/X11/xkb/compat/pc', '/usr/share/X11/xkb/geometry/pc', '/usr/share/X11/xkb/keycodes/evdev', '/usr/share/X11/xkb/symbols/pc', '/usr/share/X11/xkb/types/pc'], \ 'xmath': ['file.msc', 'file.msf'], - \ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.fsproj', 'file.fsproj.user', 'file.vbproj', 'file.vbproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd', 'fonts.conf'], + \ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.fsproj', 'file.fsproj.user', 'file.vbproj', 'file.vbproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd', 'fonts.conf', 'file.xcu', 'file.xlb', 'file.xlc', 'file.xba', 'file.xpr', 'file.xpfm', 'file.spfm', 'file.bxml'], \ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'], \ 'xpm': ['file.xpm'], \ 'xpm2': ['file.xpm2'], @@ -766,15 +836,21 @@ func s:GetFilenameChecks() abort \ 'zimbu': ['file.zu'], \ 'zimbutempl': ['file.zut'], \ 'zserio': ['file.zs'], - \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', 'file.zsh-theme', 'file.zunit', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zsh_history', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'], - \ 'help': [$VIMRUNTIME . '/doc/help.txt'], + \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', 'file.zsh-theme', 'file.zunit', + \ '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zsh_history', + \ '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', + \ 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'], + \ + \ 'help': [$VIMRUNTIME .. '/doc/help.txt'], \ } endfunc -let s:filename_case_checks = { +func s:GetFilenameCaseChecks() abort + return { \ 'modula2': ['file.DEF'], \ 'bzl': ['file.BUILD', 'BUILD', 'BUCK'], \ } +endfunc func CheckItems(checks) set noswapfile @@ -809,26 +885,29 @@ func Test_filetype_detection() filetype on call CheckItems(s:GetFilenameChecks()) if has('fname_case') - call CheckItems(s:filename_case_checks) + call CheckItems(s:GetFilenameCaseChecks()) endif filetype off endfunc " Content lines that should not result in filetype detection -let s:false_positive_checks = { +func s:GetFalsePositiveChecks() abort + return { \ '': [['test execve("/usr/bin/pstree", ["pstree"], 0x7ff0 /* 63 vars */) = 0']], \ } +endfunc " Filetypes detected from the file contents by scripts.vim -let s:script_checks = { +func s:GetScriptChecks() abort + return { \ 'virata': [['% Virata'], - \ ['', '% Virata'], - \ ['', '', '% Virata'], - \ ['', '', '', '% Virata'], - \ ['', '', '', '', '% Virata']], + \ ['', '% Virata'], + \ ['', '', '% Virata'], + \ ['', '', '', '% Virata'], + \ ['', '', '', '', '% Virata']], \ 'strace': [['execve("/usr/bin/pstree", ["pstree"], 0x7ff0 /* 63 vars */) = 0'], - \ ['15:17:47 execve("/usr/bin/pstree", ["pstree"], ... "_=/usr/bin/strace"]) = 0'], - \ ['__libc_start_main and something']], + \ ['15:17:47 execve("/usr/bin/pstree", ["pstree"], ... "_=/usr/bin/strace"]) = 0'], + \ ['__libc_start_main and something']], \ 'clojure': [['#!/path/clojure']], \ 'scala': [['#!/path/scala']], \ 'sh': [['#!/path/sh'], @@ -892,9 +971,11 @@ let s:script_checks = { \ 'janet': [['#!/path/janet']], \ 'dart': [['#!/path/dart']], \ } +endfunc " Various forms of "env" optional arguments. -let s:script_env_checks = { +func s:GetScriptEnvChecks() abort + return { \ 'perl': [['#!/usr/bin/env VAR=val perl']], \ 'scala': [['#!/usr/bin/env VAR=val VVAR=vval scala']], \ 'awk': [['#!/usr/bin/env VAR=val -i awk']], @@ -904,6 +985,7 @@ let s:script_env_checks = { \ 'wml': [['#!/usr/bin/env VAR=val --split-string wml']], \ 'nix': [['#!/usr/bin/env nix-shell']], \ } +endfunc func Run_script_detection(test_dict) filetype on @@ -919,9 +1001,9 @@ func Run_script_detection(test_dict) endfunc func Test_script_detection() - call Run_script_detection(s:false_positive_checks) - call Run_script_detection(s:script_checks) - call Run_script_detection(s:script_env_checks) + call Run_script_detection(s:GetFalsePositiveChecks()) + call Run_script_detection(s:GetScriptChecks()) + call Run_script_detection(s:GetScriptEnvChecks()) endfunc func Test_setfiletype_completion() diff --git a/test/old/testdir/test_let.vim b/test/old/testdir/test_let.vim index d93d33b199..655c177385 100644 --- a/test/old/testdir/test_let.vim +++ b/test/old/testdir/test_let.vim @@ -410,10 +410,16 @@ func Test_let_heredoc_fails() endtry try + let [] =<< trim TEXT + TEXT + call assert_report('No exception thrown') + catch /E475:/ + catch + call assert_report('Caught exception: ' .. v:exception) + endtry + + try let [a b c] =<< trim TEXT - change - insert - append TEXT call assert_report('No exception thrown') catch /E475:/ @@ -423,9 +429,6 @@ func Test_let_heredoc_fails() try let [a; b; c] =<< trim TEXT - change - insert - append TEXT call assert_report('No exception thrown') catch /E452:/ diff --git a/test/old/testdir/test_normal.vim b/test/old/testdir/test_normal.vim index 9f9d9367dc..62804b0142 100644 --- a/test/old/testdir/test_normal.vim +++ b/test/old/testdir/test_normal.vim @@ -4247,4 +4247,14 @@ func Test_halfpage_scrolloff_eob() bwipe! endfunc +" Test for Ctrl-U/D moving the cursor at the buffer boundaries. +func Test_halfpage_cursor_startend() + call setline(1, range(1, 100)) + exe "norm! jztj\<C-U>" + call assert_equal(1, line('.')) + exe "norm! G\<C-Y>k\<C-D>" + call assert_equal(100, line('.')) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab nofoldenable diff --git a/test/old/testdir/test_regexp_utf8.vim b/test/old/testdir/test_regexp_utf8.vim index b3f5e346a0..97f48a0c09 100644 --- a/test/old/testdir/test_regexp_utf8.vim +++ b/test/old/testdir/test_regexp_utf8.vim @@ -611,32 +611,4 @@ func Test_combining_chars_in_collection() bw! endfunc -func Test_search_multibyte_match_ascii() - new - " Match single 'ſ' and 's' - call setline(1, 'das abc heraus abc ſich abc ſind') - for i in range(0, 2) - exe "set re="..i - let ic_match = matchbufline('%', '\c\%u17f', 1, '$')->mapnew({idx, val -> val.text}) - let noic_match = matchbufline('%', '\C\%u17f', 1, '$')->mapnew({idx, val -> val.text}) - call assert_equal(['s', 's', 'ſ','ſ'], ic_match, "Ignorecase Regex-engine: " .. &re) - call assert_equal(['ſ','ſ'], noic_match, "No-Ignorecase Regex-engine: " .. &re) - endfor - " Match several 'ſſ' and 'ss' - call setline(1, 'das abc herauss abc ſſich abc ſind') - for i in range(0, 2) - exe "set re="..i - let ic_match = matchbufline('%', '\c\%u17f\%u17f', 1, '$')->mapnew({idx, val -> val.text}) - let noic_match = matchbufline('%', '\C\%u17f\%u17f', 1, '$')->mapnew({idx, val -> val.text}) - let ic_match2 = matchbufline('%', '\c\%u17f\+', 1, '$')->mapnew({idx, val -> val.text}) - let noic_match2 = matchbufline('%', '\C\%u17f\+', 1, '$')->mapnew({idx, val -> val.text}) - - call assert_equal(['ss', 'ſſ'], ic_match, "Ignorecase Regex-engine: " .. &re) - call assert_equal(['ſſ'], noic_match, "No-Ignorecase Regex-engine: " .. &re) - call assert_equal(['s', 'ss', 'ſſ', 'ſ'], ic_match2, "Ignorecase Regex-engine: " .. &re) - call assert_equal(['ſſ','ſ'], noic_match2, "No-Ignorecase Regex-engine: " .. &re) - endfor - bw! -endfunc - " vim: shiftwidth=2 sts=2 expandtab diff --git a/test/unit/api/private_helpers_spec.lua b/test/unit/api/private_helpers_spec.lua index 282a2e7f8e..a31374bd70 100644 --- a/test/unit/api/private_helpers_spec.lua +++ b/test/unit/api/private_helpers_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local t_eval = require('test.unit.eval.testutil') local api_t = require('test.unit.api.testutil') diff --git a/test/unit/api/testutil.lua b/test/unit/api/testutil.lua index 2790bca085..0946ef194c 100644 --- a/test/unit/api/testutil.lua +++ b/test/unit/api/testutil.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(nil) +local t = require('test.unit.testutil') local t_eval = require('test.unit.eval.testutil') local cimport = t.cimport diff --git a/test/unit/buffer_spec.lua b/test/unit/buffer_spec.lua index beedc6b5f1..a7c672322b 100644 --- a/test/unit/buffer_spec.lua +++ b/test/unit/buffer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local to_cstr = t.to_cstr diff --git a/test/unit/charset/vim_str2nr_spec.lua b/test/unit/charset/vim_str2nr_spec.lua index f83fc3b96b..a70ee77716 100644 --- a/test/unit/charset/vim_str2nr_spec.lua +++ b/test/unit/charset/vim_str2nr_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local bit = require('bit') local itp = t.gen_itp(it) diff --git a/test/unit/eval/decode_spec.lua b/test/unit/eval/decode_spec.lua index 1f36d95473..7e037500b9 100644 --- a/test/unit/eval/decode_spec.lua +++ b/test/unit/eval/decode_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/eval/encode_spec.lua b/test/unit/eval/encode_spec.lua index d0eeedf4b0..5b9188163e 100644 --- a/test/unit/eval/encode_spec.lua +++ b/test/unit/eval/encode_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local t_eval = require('test.unit.eval.testutil') diff --git a/test/unit/eval/testutil.lua b/test/unit/eval/testutil.lua index 5809877341..78788e5837 100644 --- a/test/unit/eval/testutil.lua +++ b/test/unit/eval/testutil.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(nil) +local t = require('test.unit.testutil') local ptr2key = t.ptr2key local cimport = t.cimport diff --git a/test/unit/eval/tricks_spec.lua b/test/unit/eval/tricks_spec.lua index c67bfa4fac..20ecf0d920 100644 --- a/test/unit/eval/tricks_spec.lua +++ b/test/unit/eval/tricks_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local t_eval = require('test.unit.eval.testutil') local itp = t.gen_itp(it) diff --git a/test/unit/eval/tv_clear_spec.lua b/test/unit/eval/tv_clear_spec.lua index 86ddde9d7d..1ad537d8bf 100644 --- a/test/unit/eval/tv_clear_spec.lua +++ b/test/unit/eval/tv_clear_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local t_eval = require('test.unit.eval.testutil') diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 029a6d53a4..c69c9b0fae 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1,5 +1,5 @@ local bit = require('bit') -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local t_eval = require('test.unit.eval.testutil') local itp = t.gen_itp(it) diff --git a/test/unit/fileio_spec.lua b/test/unit/fileio_spec.lua index 55332cee87..8f915372fe 100644 --- a/test/unit/fileio_spec.lua +++ b/test/unit/fileio_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) --{:cimport, :internalize, :eq, :neq, :ffi, :lib, :cstr, :to_cstr} = require 'test.unit.testutil' diff --git a/test/unit/garray_spec.lua b/test/unit/garray_spec.lua index f0b991a051..30d1d3f21e 100644 --- a/test/unit/garray_spec.lua +++ b/test/unit/garray_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/indent_spec.lua b/test/unit/indent_spec.lua index 8fa848b086..a1c3dc4a75 100644 --- a/test/unit/indent_spec.lua +++ b/test/unit/indent_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local to_cstr = t.to_cstr diff --git a/test/unit/keycodes_spec.lua b/test/unit/keycodes_spec.lua index 7c8fd47c21..948f0a3ead 100644 --- a/test/unit/keycodes_spec.lua +++ b/test/unit/keycodes_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local ffi = t.ffi diff --git a/test/unit/marktree_spec.lua b/test/unit/marktree_spec.lua index 3e6081a078..cccce5ca8f 100644 --- a/test/unit/marktree_spec.lua +++ b/test/unit/marktree_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local ffi = t.ffi diff --git a/test/unit/mbyte_spec.lua b/test/unit/mbyte_spec.lua index 1a28f9c43d..8fcc67d20b 100644 --- a/test/unit/mbyte_spec.lua +++ b/test/unit/mbyte_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local ffi = t.ffi diff --git a/test/unit/memory_spec.lua b/test/unit/memory_spec.lua index fb49bdf8e5..169d6b9cb0 100644 --- a/test/unit/memory_spec.lua +++ b/test/unit/memory_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/message_spec.lua b/test/unit/message_spec.lua index 5653f8ee5b..fee8f5124d 100644 --- a/test/unit/message_spec.lua +++ b/test/unit/message_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local ffi = t.ffi diff --git a/test/unit/msgpack_spec.lua b/test/unit/msgpack_spec.lua index 0bebbef141..730c4f9e36 100644 --- a/test/unit/msgpack_spec.lua +++ b/test/unit/msgpack_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local cimport = t.cimport local itp = t.gen_itp(it) local lib = cimport('./src/nvim/msgpack_rpc/unpacker.h', './src/nvim/memory.h') diff --git a/test/unit/multiqueue_spec.lua b/test/unit/multiqueue_spec.lua index 0866bc1f0c..931a5efa94 100644 --- a/test/unit/multiqueue_spec.lua +++ b/test/unit/multiqueue_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local child_call_once = t.child_call_once diff --git a/test/unit/optionstr_spec.lua b/test/unit/optionstr_spec.lua index 37fe4a3a3b..b9c9ceaa85 100644 --- a/test/unit/optionstr_spec.lua +++ b/test/unit/optionstr_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local to_cstr = t.to_cstr diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua index d0231b2e2b..d8231545f3 100644 --- a/test/unit/os/env_spec.lua +++ b/test/unit/os/env_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/os/fileio_spec.lua b/test/unit/os/fileio_spec.lua index d748a6d306..fd9eb2bafb 100644 --- a/test/unit/os/fileio_spec.lua +++ b/test/unit/os/fileio_spec.lua @@ -1,6 +1,6 @@ local uv = vim.uv -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local eq = t.eq diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index e866a1b5c3..a829962305 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -1,7 +1,7 @@ local uv = vim.uv local bit = require('bit') -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua index fd0a6336b0..94ad6f4a10 100644 --- a/test/unit/os/shell_spec.lua +++ b/test/unit/os/shell_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimported = t.cimport( './src/nvim/os/shell.h', diff --git a/test/unit/os/users_spec.lua b/test/unit/os/users_spec.lua index cf81b25a44..21d47fdb6e 100644 --- a/test/unit/os/users_spec.lua +++ b/test/unit/os/users_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua index 0c94201dfa..8df6a52cd1 100644 --- a/test/unit/path_spec.lua +++ b/test/unit/path_spec.lua @@ -1,5 +1,5 @@ local uv = vim.uv -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/preload.lua b/test/unit/preload.lua index 896d07b9cd..1865bba719 100644 --- a/test/unit/preload.lua +++ b/test/unit/preload.lua @@ -2,5 +2,5 @@ -- Busted started doing this to help provide more isolation. See issue #62 -- for more information about this. local ffi = require('ffi') -local t = require('test.unit.testutil')(nil) +local t = require('test.unit.testutil') local preprocess = require('test.unit.preprocess') diff --git a/test/unit/profile_spec.lua b/test/unit/profile_spec.lua index 79d32c3a69..27b817cf42 100644 --- a/test/unit/profile_spec.lua +++ b/test/unit/profile_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/rbuffer_spec.lua b/test/unit/rbuffer_spec.lua index 4b2d64cd48..ad18ea2ddc 100644 --- a/test/unit/rbuffer_spec.lua +++ b/test/unit/rbuffer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local eq = t.eq diff --git a/test/unit/search_spec.lua b/test/unit/search_spec.lua index 4572beaae0..f68cd88c12 100644 --- a/test/unit/search_spec.lua +++ b/test/unit/search_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local to_cstr = t.to_cstr diff --git a/test/unit/statusline_spec.lua b/test/unit/statusline_spec.lua index 41afa3c897..973d9ec992 100644 --- a/test/unit/statusline_spec.lua +++ b/test/unit/statusline_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local to_cstr = t.to_cstr diff --git a/test/unit/strings_spec.lua b/test/unit/strings_spec.lua index e686998e84..6e88f5141d 100644 --- a/test/unit/strings_spec.lua +++ b/test/unit/strings_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local cimport = t.cimport diff --git a/test/unit/tempfile_spec.lua b/test/unit/tempfile_spec.lua index 3308eaebb2..1a42eed17e 100644 --- a/test/unit/tempfile_spec.lua +++ b/test/unit/tempfile_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local eq = t.eq diff --git a/test/unit/testtest_spec.lua b/test/unit/testtest_spec.lua index 79f29f4e54..0750cac5cc 100644 --- a/test/unit/testtest_spec.lua +++ b/test/unit/testtest_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local assert = require('luassert') local itp = t.gen_itp(it) diff --git a/test/unit/testutil.lua b/test/unit/testutil.lua index c1ba1f6e97..c90859581d 100644 --- a/test/unit/testutil.lua +++ b/test/unit/testutil.lua @@ -906,6 +906,4 @@ local module = { --- @class test.unit.testutil: test.unit.testutil.module, test.testutil module = vim.tbl_extend('error', module, t_global) -return function() - return module -end +return module diff --git a/test/unit/undo_spec.lua b/test/unit/undo_spec.lua index 847ac7789a..5a96280caf 100644 --- a/test/unit/undo_spec.lua +++ b/test/unit/undo_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local uv = vim.uv local child_call_once = t.child_call_once diff --git a/test/unit/viml/expressions/lexer_spec.lua b/test/unit/viml/expressions/lexer_spec.lua index 9b2ad0a84b..30483f4c1d 100644 --- a/test/unit/viml/expressions/lexer_spec.lua +++ b/test/unit/viml/expressions/lexer_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local t_viml = require('test.unit.viml.testutil') diff --git a/test/unit/viml/expressions/parser_spec.lua b/test/unit/viml/expressions/parser_spec.lua index 74f2a120bf..6f18448bd2 100644 --- a/test/unit/viml/expressions/parser_spec.lua +++ b/test/unit/viml/expressions/parser_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(after_each) +local t = require('test.unit.testutil') local itp = t.gen_itp(it) local t_viml = require('test.unit.viml.testutil') diff --git a/test/unit/viml/testutil.lua b/test/unit/viml/testutil.lua index 7046cedb47..376ef538d4 100644 --- a/test/unit/viml/testutil.lua +++ b/test/unit/viml/testutil.lua @@ -1,4 +1,4 @@ -local t = require('test.unit.testutil')(nil) +local t = require('test.unit.testutil') local ffi = t.ffi local cimport = t.cimport |