functests: Check logs in lua code

It is otherwise impossible to determine which test failed sanitizer/valgrind
check. test/functional/helpers.lua module return was changed so that tests which
do not provide after_each function to get new check will automatically fail.
This commit is contained in:
ZyX 2016-04-24 02:53:11 +03:00
parent a160590e40
commit ff470bb853
212 changed files with 362 additions and 287 deletions

View File

@ -1,5 +1,5 @@
-- Sanity checks for buffer_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, buffer = helpers.clear, helpers.nvim, helpers.buffer
local curbuf, curwin, eq = helpers.curbuf, helpers.curwin, helpers.eq
local curbufmeths, ok = helpers.curbufmeths, helpers.ok

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear

View File

@ -1,5 +1,5 @@
-- Tests for nvim notifications
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eq, clear, eval, execute, nvim, next_message =
helpers.eq, helpers.clear, helpers.eval, helpers.execute, helpers.nvim,
helpers.next_message

View File

@ -1,7 +1,7 @@
-- Tests for some server->client RPC scenarios. Note that unlike with
-- `rpcnotify`, to evaluate `rpcrequest` calls we need the client event loop to
-- be running.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval
local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop
local nvim_prog = helpers.nvim_prog

View File

@ -1,5 +1,5 @@
-- Sanity checks for tabpage_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, tabpage, curtab, eq, ok =
helpers.clear, helpers.nvim, helpers.tabpage, helpers.curtab, helpers.eq,
helpers.ok

View File

@ -1,5 +1,5 @@
-- Sanity checks for vim_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local NIL = helpers.NIL
local clear, nvim, eq, neq = helpers.clear, helpers.nvim, helpers.eq, helpers.neq

View File

@ -1,5 +1,5 @@
-- Sanity checks for window_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq,
ok, feed, insert, eval = helpers.clear, helpers.nvim, helpers.curbuf,
helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq,

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local command = helpers.command

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq
describe('TabClosed', function()

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local command = helpers.command

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq
describe('TabNewEntered', function()

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, execute, feed, nvim, nvim_dir = helpers.clear,

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq
local feed, execute, expect, command = helpers.feed, helpers.execute, helpers.expect, helpers.command
local curbufmeths, funcs, neq = helpers.curbufmeths, helpers.funcs, helpers.neq

View File

@ -1,6 +1,6 @@
-- Test clipboard provider support
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect, eq, eval = helpers.execute, helpers.expect, helpers.eq, helpers.eval

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, source = helpers.clear, helpers.nvim, helpers.source
local eq, next_msg = helpers.eq, helpers.next_message
local exc_exec = helpers.exc_exec

View File

@ -1,5 +1,5 @@
local lfs = require('lfs')
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, eval, eq = helpers.clear, helpers.execute, helpers.eval, helpers.eq
before_each(function()

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local funcs = helpers.funcs
local meths = helpers.meths

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local funcs = helpers.funcs
local eval, eq = helpers.eval, helpers.eq

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
local eval = helpers.eval
local clear = helpers.clear

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local funcs = helpers.funcs

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, ok = helpers.clear, helpers.eq, helpers.ok
local neq, execute, funcs = helpers.neq, helpers.execute, helpers.funcs
local reltime, reltimestr, reltimefloat = funcs.reltime, funcs.reltimestr, funcs.reltimefloat

View File

@ -1,5 +1,5 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local nvim, eq, neq, eval = helpers.nvim, helpers.eq, helpers.neq, helpers.eval
local clear, funcs, meths = helpers.clear, helpers.funcs, helpers.meths
local os_name = helpers.os_name

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local exc_exec = helpers.exc_exec
local execute = helpers.execute
local funcs = helpers.funcs

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local command = helpers.command

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local ok, feed, eq, eval = helpers.ok, helpers.feed, helpers.eq, helpers.eval
local source, nvim_async, run = helpers.source, helpers.nvim_async, helpers.run

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq
local command = helpers.command
describe('v:event', function()

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
local feed = helpers.feed

View File

@ -1,7 +1,7 @@
-- Specs for :cd, :tcd, :lcd and getcwd()
local lfs = require('lfs')
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
local call = helpers.call

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, feed = helpers.clear, helpers.execute, helpers.feed
local eq, neq, eval = helpers.eq, helpers.neq, helpers.eval

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, feed, ok, eval =
helpers.clear, helpers.execute, helpers.feed, helpers.ok, helpers.eval

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, nvim = helpers.clear, helpers.execute, helpers.nvim
local expect, feed, command = helpers.expect, helpers.feed, helpers.command
local eq, eval = helpers.eq, helpers.eval

View File

@ -1,5 +1,5 @@
local Screen = require('test.functional.ui.screen')
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local buf, eq, execute = helpers.curbufmeths, helpers.eq, helpers.execute
local feed, nvim_prog, wait = helpers.feed, helpers.nvim_prog, helpers.wait

View File

@ -1,7 +1,7 @@
require('os')
local lfs = require('lfs')
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eval = helpers.eval
local command = helpers.command
local eq, neq = helpers.eq, helpers.neq

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
describe(':qa', function()

View File

@ -1,6 +1,6 @@
-- Tests for :recover
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local lfs = require('lfs')
local execute, eq, clear, eval, feed, expect, source =
helpers.execute, helpers.eq, helpers.clear, helpers.eval, helpers.feed,

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, eq = helpers.clear, helpers.nvim, helpers.eq
describe('sign', function()

View File

@ -1,6 +1,6 @@
-- Specs for :write
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local eq, eval, clear, write_file, execute, source =
helpers.eq, helpers.eval, helpers.clear, helpers.write_file,
helpers.execute, helpers.source

View File

@ -1,6 +1,6 @@
-- Specs for :wundo and underlying functions
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local execute, clear, eval, feed, spawn, nvim_prog, set_session =
helpers.execute, helpers.clear, helpers.eval, helpers.feed, helpers.spawn,
helpers.nvim_prog, helpers.set_session

View File

@ -1,4 +1,5 @@
local helpers, lfs = require('test.functional.helpers'), require('lfs')
local helpers = require('test.functional.helpers')(after_each)
local lfs = require('lfs')
local execute, eq, neq, spawn, nvim_prog, set_session, wait, write_file
= helpers.execute, helpers.eq, helpers.neq, helpers.spawn,
helpers.nvim_prog, helpers.set_session, helpers.wait, helpers.write_file

View File

@ -1,4 +1,4 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, meths, funcs, eq =
helpers.clear, helpers.meths, helpers.funcs, helpers.eq

View File

@ -1,8 +1,13 @@
require('coxpcall')
local lfs = require('lfs')
local assert = require('luassert')
local ChildProcessStream = require('nvim.child_process_stream')
local Session = require('nvim.session')
local global_helpers = require('test.helpers')
local check_logs = global_helpers.check_logs
local neq = global_helpers.neq
local eq = global_helpers.eq
local ok = global_helpers.ok
local nvim_prog = os.getenv('NVIM_PROG') or 'build/bin/nvim'
local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N',
@ -267,18 +272,6 @@ local function source(code)
return tmpname
end
local function eq(expected, actual)
return assert.are.same(expected, actual)
end
local function neq(expected, actual)
return assert.are_not.same(expected, actual)
end
local function ok(expr)
assert.is_true(expr)
end
local function nvim(method, ...)
return request('vim_'..method, ...)
end
@ -412,54 +405,59 @@ local curbufmeths = create_callindex(curbuf)
local curwinmeths = create_callindex(curwin)
local curtabmeths = create_callindex(curtab)
return {
prepend_argv = prepend_argv,
clear = clear,
spawn = spawn,
dedent = dedent,
source = source,
rawfeed = rawfeed,
insert = insert,
feed = feed,
execute = execute,
eval = nvim_eval,
call = nvim_call,
command = nvim_command,
request = request,
next_message = next_message,
run = run,
stop = stop,
eq = eq,
neq = neq,
expect = expect,
ok = ok,
nvim = nvim,
nvim_async = nvim_async,
nvim_prog = nvim_prog,
nvim_dir = nvim_dir,
buffer = buffer,
window = window,
tabpage = tabpage,
curbuf = curbuf,
curwin = curwin,
curtab = curtab,
curbuf_contents = curbuf_contents,
wait = wait,
set_session = set_session,
write_file = write_file,
os_name = os_name,
rmdir = rmdir,
mkdir = lfs.mkdir,
exc_exec = exc_exec,
redir_exec = redir_exec,
merge_args = merge_args,
funcs = funcs,
meths = meths,
bufmeths = bufmeths,
winmeths = winmeths,
tabmeths = tabmeths,
curbufmeths = curbufmeths,
curwinmeths = curwinmeths,
curtabmeths = curtabmeths,
NIL = mpack.NIL
}
return function(after_each)
if after_each then
after_each(check_logs)
end
return {
prepend_argv = prepend_argv,
clear = clear,
spawn = spawn,
dedent = dedent,
source = source,
rawfeed = rawfeed,
insert = insert,
feed = feed,
execute = execute,
eval = nvim_eval,
call = nvim_call,
command = nvim_command,
request = request,
next_message = next_message,
run = run,
stop = stop,
eq = eq,
neq = neq,
expect = expect,
ok = ok,
nvim = nvim,
nvim_async = nvim_async,
nvim_prog = nvim_prog,
nvim_dir = nvim_dir,
buffer = buffer,
window = window,
tabpage = tabpage,
curbuf = curbuf,
curwin = curwin,
curtab = curtab,
curbuf_contents = curbuf_contents,
wait = wait,
set_session = set_session,
write_file = write_file,
os_name = os_name,
rmdir = rmdir,
mkdir = lfs.mkdir,
exc_exec = exc_exec,
redir_exec = redir_exec,
merge_args = merge_args,
funcs = funcs,
meths = meths,
bufmeths = bufmeths,
winmeths = winmeths,
tabmeths = tabmeths,
curbufmeths = curbufmeths,
curwinmeths = curwinmeths,
curtabmeths = curtabmeths,
NIL = mpack.NIL,
}
end

View File

@ -1,5 +1,5 @@
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, eval, execute, feed, insert, neq, next_msg, nvim,
nvim_dir, ok, source, write_file, mkdir, rmdir = helpers.clear,
helpers.eq, helpers.eval, helpers.execute, helpers.feed,

View File

@ -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 helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -3,7 +3,7 @@
-- There are 50+ test command blocks (the stuff between STARTTEST and ENDTEST)
-- in the original test. These have been converted to "it" test cases here.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -2,7 +2,7 @@
-- Test for autocommand that changes current buffer on BufEnter event.
-- Check if modelines are interpreted for the correct buffer.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -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 helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test for autocommand that redefines the argument list, when doing ":all".
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, dedent, eq = helpers.execute, helpers.dedent, helpers.eq
local curbuf_contents = helpers.curbuf_contents

View File

@ -1,6 +1,6 @@
-- Test for autocommand that changes the buffer list, when doing ":ball".
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test for Bufleave autocommand that deletes the buffer we are about to edit.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, insert = helpers.clear, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Test for 'errorformat'. This will fail if the quickfix feature was
-- disabled.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, clear, execute = helpers.feed, helpers.clear, helpers.execute
local expect, write_file = helpers.expect, helpers.write_file

View File

@ -12,7 +12,8 @@
-- Use a FileChangedShell autocommand to avoid a prompt for "Xtestfile.gz"
-- being modified outside of Vim (noticed on Solaris).
local helpers, lfs = require('test.functional.helpers'), require('lfs')
local helpers= require('test.functional.helpers')(after_each)
local lfs = require('lfs')
local clear, execute, expect, eq, neq, dedent, write_file, feed =
helpers.clear, helpers.execute, helpers.expect, helpers.eq, helpers.neq,
helpers.dedent, helpers.write_file, helpers.feed

View File

@ -2,7 +2,7 @@
-- Also test formatting a paragraph.
-- Also test undo after ":%s" and formatting.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for not doing smart indenting when it isn't set.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
-- Also test that dv_ works correctly
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -3,7 +3,7 @@
-- First test for undo working properly when executing commands from a register.
-- Also test this in an empty buffer.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for file with some lines ending in CTRL-M, some not
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed = helpers.clear, helpers.feed
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for complicated + argument to :edit command
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, insert = helpers.clear, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -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 helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test for :execute, :while and :if
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local execute, expect = helpers.execute, helpers.expect
local source = helpers.source

View File

@ -1,6 +1,6 @@
-- Test for sourcing a file with CTRL-V's at the end of the line
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test for joining lines with marks in them (and with 'joinspaces' set/reset)
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -9,9 +9,14 @@
-- :buf
-- :edit
local helpers = require('test.functional.helpers')
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local helpers = require('test.functional.helpers')(after_each)
local feed = helpers.feed
local clear = helpers.clear
local source = helpers.source
local insert = helpers.insert
local expect = helpers.expect
local execute = helpers.execute
describe('Commands that close windows and/or buffers', function()
setup(clear)

View File

@ -2,7 +2,7 @@
-- Test for 'lisp'
-- If the lisp feature is not enabled, this will fail!
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -3,7 +3,7 @@
-- Also test that a builtin function cannot be replaced.
-- Also test for regression when calling arbitrary expression.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Test Ctrl-A and Ctrl-X, which increment and decrement decimal, hexadecimal,
-- and octal numbers.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test character classes in regexp using regexpengine 0, 1, 2.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local source, write_file = helpers.source, helpers.write_file
local os_name = helpers.os_name

View File

@ -1,6 +1,6 @@
-- Test Virtual replace mode.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed = helpers.feed
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Test Visual block mode commands
-- And test "U" in Visual mode, also on German sharp S.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local nvim, eq = helpers.meths, helpers.eq
local insert, feed = helpers.insert, helpers.feed
local clear, expect = helpers.clear, helpers.expect

View File

@ -1,6 +1,6 @@
-- Test for writing and reading a file of over 100 Kbyte
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Tests for regexp with various magic settings.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -3,7 +3,7 @@
--
-- This test contains both "test44" and "test99" from the old test suite.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for folding.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, clear, execute, expect =
helpers.feed, helpers.insert, helpers.clear, helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Tests for multi-line regexps with ":s"
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local expect = helpers.expect

View File

@ -2,7 +2,7 @@
-- Tests for ":highlight".
local Screen = require('test.functional.ui.screen')
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed = helpers.clear, helpers.feed
local execute, expect = helpers.execute, helpers.expect
local wait = helpers.wait

View File

@ -1,6 +1,6 @@
-- Some tests for buffer-local autocommands
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, execute, eq = helpers.clear, helpers.execute, helpers.eq
local curbuf_contents = helpers.curbuf_contents

View File

@ -1,6 +1,6 @@
-- Tests for List and Dictionary types.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, source = helpers.feed, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Test for script-local function.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local expect = helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for :sort command.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local insert, execute, clear, expect, eq, eval, source = helpers.insert,
helpers.execute, helpers.clear, helpers.expect, helpers.eq, helpers.eval,
helpers.source

View File

@ -1,6 +1,6 @@
-- Tests for spell checking with 'encoding' set to "utf-8".
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local write_file, call = helpers.write_file, helpers.call

View File

@ -1,6 +1,6 @@
-- Tests for the exists() and has() functions.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local source = helpers.source
local clear, expect = helpers.clear, helpers.expect
local write_file = helpers.write_file

View File

@ -1,9 +1,15 @@
-- Tests for undo tree and :earlier and :later.
local helpers = require('test.functional.helpers')(after_each)
local helpers = require('test.functional.helpers')
local expect, feed, source = helpers.expect, helpers.feed, helpers.source
local eval, clear, execute = helpers.eval, helpers.clear, helpers.execute
local write_file, command, eq = helpers.write_file, helpers.command, helpers.eq
local write_file = helpers.write_file
local execute = helpers.execute
local command = helpers.command
local source = helpers.source
local expect = helpers.expect
local clear = helpers.clear
local feed = helpers.feed
local eval = helpers.eval
local eq = helpers.eq
local function expect_empty_buffer()
-- The space will be removed by helpers.dedent but is needed because dedent

View File

@ -1,6 +1,6 @@
-- Tests for tab pages
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, source, clear, execute, expect, eval, eq =
helpers.feed, helpers.insert, helpers.source, helpers.clear,
helpers.execute, helpers.expect, helpers.eval, helpers.eq

View File

@ -1,6 +1,6 @@
-- Tests for adjusting window and contents
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local feed, insert = helpers.feed, helpers.insert
local eval, clear, execute = helpers.eval, helpers.clear, helpers.execute

View File

@ -1,6 +1,6 @@
-- Test for floating point and logical operators.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local insert, source = helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- vim: set foldmethod=marker foldmarker=[[,]] :
-- Test for visual block shift and tab characters.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Test that groups and patterns are tested correctly when calling exists() for
-- autocommands.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,10 @@
local helpers = require('test.functional.helpers')
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local helpers = require('test.functional.helpers')(after_each)
local feed = helpers.feed
local clear = helpers.clear
local insert = helpers.insert
local execute = helpers.execute
local expect = helpers.expect
describe('text formatting', function()
setup(clear)

View File

@ -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 helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,6 +1,7 @@
-- Tests for storing global variables in the .shada file
local helpers, lfs = require('test.functional.helpers'), require('lfs')
local helpers = require('test.functional.helpers')(after_each)
local lfs = require('lfs')
local clear, execute, eq, neq, eval, wait, spawn =
helpers.clear, helpers.execute, helpers.eq, helpers.neq, helpers.eval,
helpers.wait, helpers.spawn

View File

@ -1,7 +1,7 @@
-- Tests for maparg().
-- Also test utf8 map with a 0x80 byte.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed = helpers.clear, helpers.feed
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for completefunc/omnifunc.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, expect, execute = helpers.clear, helpers.expect, helpers.execute

View File

@ -6,7 +6,7 @@
-- cksum is part of POSIX and so should be available on most Unixes.
-- If it isn't available then the test will be skipped.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed = helpers.feed
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -3,7 +3,7 @@
-- restored. We need about 10000 lines of 100 characters to get two levels of
-- pointer blocks.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, expect, source = helpers.clear, helpers.expect, helpers.source
describe('78', function()

View File

@ -2,7 +2,7 @@
-- Test for submatch() on substitue().
-- Test for *:s%* on :substitute.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
local eq, eval = helpers.eq, helpers.eval

View File

@ -1,6 +1,6 @@
-- Test for t movement command and 'cpo-;' setting
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local execute, expect = helpers.execute, helpers.expect

View File

@ -1,7 +1,7 @@
-- Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c)
-- Also test "g~ap".
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, source = helpers.feed, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect

View File

@ -1,6 +1,6 @@
-- Tests for tag search with !_TAG_FILE_ENCODING.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local insert, source, clear, expect, write_file = helpers.insert,
helpers.source, helpers.clear, helpers.expect, helpers.write_file

View File

@ -1,6 +1,6 @@
-- Tests for curswant not changing when setting an option.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local insert, source = helpers.insert, helpers.source
local clear, expect = helpers.clear, helpers.expect

View File

@ -1,7 +1,7 @@
-- Tests for correct display (cursor column position) with +conceal and
-- tabulators.
local helpers = require('test.functional.helpers')
local helpers = require('test.functional.helpers')(after_each)
local feed, insert, clear, execute =
helpers.feed, helpers.insert, helpers.clear, helpers.execute

Some files were not shown because too many files have changed in this diff Show More