mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
This commit is contained in:
parent
978962f9a0
commit
7035125b2b
@ -46,7 +46,7 @@ if(DEFINED ENV{TEST_FILTER_OUT} AND NOT "$ENV{TEST_FILTER_OUT}" STREQUAL "")
|
||||
list(APPEND BUSTED_ARGS --filter-out $ENV{TEST_FILTER_OUT})
|
||||
endif()
|
||||
|
||||
# TMPDIR: for helpers.tmpname() and Nvim tempname().
|
||||
# TMPDIR: for testutil.tmpname() and Nvim tempname().
|
||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
||||
|
||||
@ -57,7 +57,7 @@ if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "")
|
||||
set(ENV{TEST_TIMEOUT} 1200)
|
||||
endif()
|
||||
|
||||
set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/helpers.lua.
|
||||
set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/testutil.lua.
|
||||
|
||||
if(NOT WIN32)
|
||||
# Tests assume POSIX "sh" and may fail if SHELL=fish. #24941 #6172
|
||||
|
@ -88,7 +88,7 @@ Then, in another terminal:
|
||||
gdb build/bin/nvim
|
||||
target remote localhost:7777
|
||||
<
|
||||
- See also test/functional/helpers.lua https://github.com/neovim/neovim/blob/3098b18a2b63a841351f6d5e3697cb69db3035ef/test/functional/helpers.lua#L38-L44.
|
||||
- See also test/functional/testutil.lua https://github.com/neovim/neovim/blob/3098b18a2b63a841351f6d5e3697cb69db3035ef/test/functional/testutil.lua#L38-L44.
|
||||
|
||||
|
||||
USING LLDB TO STEP THROUGH UNIT TESTS ~
|
||||
|
@ -282,9 +282,9 @@ open my $spec_file_handle, ">", $spec_file;
|
||||
print $spec_file_handle <<"EOS";
|
||||
@{[join "\n", @{$description_lines}]}
|
||||
|
||||
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 t = require('test.functional.testutil')
|
||||
local feed, insert, source = t.feed, t.insert, t.source
|
||||
local clear, execute, expect = t.clear, t.execute, t.expect
|
||||
|
||||
describe('$test_name', function()
|
||||
before_each(clear)
|
||||
|
@ -44,9 +44,9 @@ Layout
|
||||
parser: normally used to make macros not accessible via this mechanism
|
||||
accessible the other way.
|
||||
- `/test/*/preload.lua` : modules preloaded by busted `--helper` option
|
||||
- `/test/**/helpers.lua` : common utility functions for test code
|
||||
- `/test/**/testutil.lua` : common utility functions for test code
|
||||
- `/test/*/**/*_spec.lua` : actual tests. Files that do not end with
|
||||
`_spec.lua` are libraries like `/test/**/helpers.lua`, except that they have
|
||||
`_spec.lua` are libraries like `/test/**/testutil.lua`, except that they have
|
||||
some common topic.
|
||||
- `/test/old/testdir` : old tests (from Vim)
|
||||
|
||||
@ -119,7 +119,7 @@ Debugging tests
|
||||
If `$VALGRIND` is also set it will pass `--vgdb=yes` to valgrind instead of
|
||||
starting gdbserver directly.
|
||||
|
||||
See [test/functional/helpers.lua](https://github.com/neovim/neovim/blob/9cadbf1d36b63f53f0de48c8c5ff6c752ff05d70/test/functional/helpers.lua#L52-L69) for details.
|
||||
See [test/functional/testutil.lua](https://github.com/neovim/neovim/blob/9cadbf1d36b63f53f0de48c8c5ff6c752ff05d70/test/functional/testutil.lua#L52-L69) for details.
|
||||
|
||||
- Hanging tests can happen due to unexpected "press-enter" prompts. The
|
||||
default screen width is 50 columns. Commands that try to print lines longer
|
||||
@ -218,7 +218,7 @@ Guidelines
|
||||
|
||||
- Luajit needs to know about type and constant declarations used in function
|
||||
prototypes. The
|
||||
[helpers.lua](https://github.com/neovim/neovim/blob/master/test/unit/helpers.lua)
|
||||
[testutil.lua](https://github.com/neovim/neovim/blob/master/test/unit/testutil.lua)
|
||||
file automatically parses `types.h`, so types used in the tested functions
|
||||
could be moved to it to avoid having to rewrite the declarations in the test
|
||||
files.
|
||||
@ -297,7 +297,7 @@ Number; !must be defined to function properly):
|
||||
- `VALGRIND` (F) (D): makes nvim instances to be run under `valgrind`. Log
|
||||
files are named `valgrind-%p.log` in this case. Note that non-empty valgrind
|
||||
log may fail tests. Valgrind arguments may be seen in
|
||||
`/test/functional/helpers.lua`. May be used in conjunction with `GDB`.
|
||||
`/test/functional/testutil.lua`. May be used in conjunction with `GDB`.
|
||||
|
||||
- `VALGRIND_LOG` (F) (S): overrides valgrind log file name used for `VALGRIND`.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local exec_lua = helpers.exec_lua
|
||||
local clear = t.clear
|
||||
local exec_lua = t.exec_lua
|
||||
|
||||
local N = 7500
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
-- Test for benchmarking the RE engine.
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local insert, source = helpers.insert, helpers.source
|
||||
local clear, command = helpers.clear, helpers.command
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local insert, source = t.insert, t.source
|
||||
local clear, command = t.clear, t.command
|
||||
|
||||
-- Temporary file for gathering benchmarking results for each regexp engine.
|
||||
local result_file = 'benchmark.out'
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- 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 helpers = require('test.functional.helpers')
|
||||
local t = require('test.functional.testutil')
|
||||
|
@ -1,5 +1,5 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local api = helpers.api
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local api = t.api
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local function rand_utf8(count, seed)
|
||||
@ -78,7 +78,7 @@ local N = 10000
|
||||
local function benchmark(lines, expected_value)
|
||||
local lnum = #lines
|
||||
|
||||
local results = helpers.exec_lua(
|
||||
local results = t.exec_lua(
|
||||
[==[
|
||||
local N, lnum = ...
|
||||
|
||||
@ -99,7 +99,7 @@ local function benchmark(lines, expected_value)
|
||||
)
|
||||
|
||||
for _, value in ipairs(results[1]) do
|
||||
helpers.eq(expected_value, value)
|
||||
t.eq(expected_value, value)
|
||||
end
|
||||
local stats = results[2]
|
||||
table.sort(stats)
|
||||
@ -119,7 +119,7 @@ end
|
||||
|
||||
local function benchmarks(benchmark_results)
|
||||
describe('screenpos() perf', function()
|
||||
before_each(helpers.clear)
|
||||
before_each(t.clear)
|
||||
|
||||
-- no breakindent
|
||||
for li, lines_type in ipairs(benchmark_lines) do
|
||||
@ -134,7 +134,7 @@ local function benchmarks(benchmark_results)
|
||||
screen:attach()
|
||||
api.nvim_buf_set_lines(0, 0, 1, false, lines)
|
||||
-- for smaller screen expect (last line always different, first line same as others)
|
||||
helpers.feed('G$')
|
||||
t.feed('G$')
|
||||
screen:expect(result.screen)
|
||||
benchmark(lines, result.value)
|
||||
end)
|
||||
@ -153,9 +153,9 @@ local function benchmarks(benchmark_results)
|
||||
local screen = Screen.new(width, height + 1)
|
||||
screen:attach()
|
||||
api.nvim_buf_set_lines(0, 0, 1, false, lines)
|
||||
helpers.command('set breakindent')
|
||||
t.command('set breakindent')
|
||||
-- for smaller screen expect (last line always different, first line same as others)
|
||||
helpers.feed('G$')
|
||||
t.feed('G$')
|
||||
screen:expect(result.screen)
|
||||
benchmark(lines, result.value)
|
||||
end)
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local exec_lua = helpers.exec_lua
|
||||
local clear = t.clear
|
||||
local exec_lua = t.exec_lua
|
||||
|
||||
describe('treesitter perf', function()
|
||||
setup(function()
|
||||
@ -9,7 +9,7 @@ describe('treesitter perf', function()
|
||||
end)
|
||||
|
||||
it('can handle large folds', function()
|
||||
helpers.command 'edit ./src/nvim/eval.c'
|
||||
t.command 'edit ./src/nvim/eval.c'
|
||||
exec_lua [[
|
||||
local parser = vim.treesitter.get_parser(0, "c", {})
|
||||
vim.treesitter.highlighter.new(parser)
|
||||
|
@ -1,13 +1,13 @@
|
||||
-- Extends the upstream TAP handler, to display the log with suiteEnd.
|
||||
|
||||
local global_helpers = require('test.helpers')
|
||||
local t_global = require('test.testutil')
|
||||
|
||||
return function(options)
|
||||
local busted = require 'busted'
|
||||
local handler = require 'busted.outputHandlers.TAP'(options)
|
||||
|
||||
local suiteEnd = function()
|
||||
io.write(global_helpers.read_nvim_log(nil, true))
|
||||
io.write(t_global.read_nvim_log(nil, true))
|
||||
return nil, true
|
||||
end
|
||||
busted.subscribe({ 'suite', 'end' }, suiteEnd)
|
||||
|
@ -1,5 +1,5 @@
|
||||
local pretty = require 'pl.pretty'
|
||||
local global_helpers = require('test.helpers')
|
||||
local t_global = require('test.testutil')
|
||||
|
||||
local colors = setmetatable({}, {
|
||||
__index = function()
|
||||
@ -236,7 +236,7 @@ return function(options)
|
||||
io.write(suiteEndString:format(testCount, tests, fileCount, files, elapsedTime_ms))
|
||||
io.write(getSummaryString())
|
||||
if failureCount > 0 or errorCount > 0 then
|
||||
io.write(global_helpers.read_nvim_log(nil, true))
|
||||
io.write(t_global.read_nvim_log(nil, true))
|
||||
end
|
||||
io.flush()
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local matches = helpers.matches
|
||||
local api = helpers.api
|
||||
local source = helpers.source
|
||||
local pcall_err = helpers.pcall_err
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local exec_lua = t.exec_lua
|
||||
local matches = t.matches
|
||||
local api = t.api
|
||||
local source = t.source
|
||||
local pcall_err = t.pcall_err
|
||||
|
||||
before_each(clear)
|
||||
|
||||
|
@ -1,21 +1,21 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local ok = helpers.ok
|
||||
local describe_lua_and_rpc = helpers.describe_lua_and_rpc(describe)
|
||||
local api = helpers.api
|
||||
local fn = helpers.fn
|
||||
local request = helpers.request
|
||||
local exc_exec = helpers.exc_exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
local feed_command = helpers.feed_command
|
||||
local insert = helpers.insert
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local ok = t.ok
|
||||
local describe_lua_and_rpc = t.describe_lua_and_rpc(describe)
|
||||
local api = t.api
|
||||
local fn = t.fn
|
||||
local request = t.request
|
||||
local exc_exec = t.exc_exec
|
||||
local exec_lua = t.exec_lua
|
||||
local feed_command = t.feed_command
|
||||
local insert = t.insert
|
||||
local NIL = vim.NIL
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local pcall_err = helpers.pcall_err
|
||||
local assert_alive = helpers.assert_alive
|
||||
local command = t.command
|
||||
local feed = t.feed
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('api/buf', function()
|
||||
before_each(clear)
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local eq, ok = helpers.eq, helpers.ok
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local command, eval, next_msg = helpers.command, helpers.eval, helpers.next_msg
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local pcall_err = helpers.pcall_err
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local eq, ok = t.eq, t.ok
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local command, eval, next_msg = t.command, t.eval, t.next_msg
|
||||
local nvim_prog = t.nvim_prog
|
||||
local pcall_err = t.pcall_err
|
||||
local sleep = vim.uv.sleep
|
||||
local write_file = helpers.write_file
|
||||
local write_file = t.write_file
|
||||
|
||||
local origlines = {
|
||||
'original line 1',
|
||||
@ -34,7 +34,7 @@ local function sendkeys(keys)
|
||||
end
|
||||
|
||||
local function open(activate, lines)
|
||||
local filename = helpers.tmpname()
|
||||
local filename = t.tmpname()
|
||||
write_file(filename, table.concat(lines, '\n') .. '\n', true)
|
||||
command('edit ' .. filename)
|
||||
local b = api.nvim_get_current_buf()
|
||||
@ -511,11 +511,11 @@ describe('API: buffer events:', function()
|
||||
|
||||
-- create several new sessions, in addition to our main API
|
||||
local sessions = {}
|
||||
local pipe = helpers.new_pipename()
|
||||
local pipe = t.new_pipename()
|
||||
eval("serverstart('" .. pipe .. "')")
|
||||
sessions[1] = helpers.connect(pipe)
|
||||
sessions[2] = helpers.connect(pipe)
|
||||
sessions[3] = helpers.connect(pipe)
|
||||
sessions[1] = t.connect(pipe)
|
||||
sessions[2] = t.connect(pipe)
|
||||
sessions[3] = t.connect(pipe)
|
||||
|
||||
local function request(sessionnr, method, ...)
|
||||
local status, rv = sessions[sessionnr]:request(method, ...)
|
||||
@ -814,7 +814,7 @@ describe('API: buffer events:', function()
|
||||
clear()
|
||||
sleep(250)
|
||||
-- response
|
||||
eq(true, helpers.request('nvim_buf_attach', 0, false, {}))
|
||||
eq(true, t.request('nvim_buf_attach', 0, false, {}))
|
||||
-- notification
|
||||
eq({
|
||||
[1] = 'notification',
|
||||
|
@ -1,17 +1,17 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local NIL = vim.NIL
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local api = helpers.api
|
||||
local matches = helpers.matches
|
||||
local source = helpers.source
|
||||
local pcall_err = helpers.pcall_err
|
||||
local exec_lua = helpers.exec_lua
|
||||
local assert_alive = helpers.assert_alive
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local api = t.api
|
||||
local matches = t.matches
|
||||
local source = t.source
|
||||
local pcall_err = t.pcall_err
|
||||
local exec_lua = t.exec_lua
|
||||
local assert_alive = t.assert_alive
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
|
||||
describe('nvim_get_commands', function()
|
||||
local cmd_dict = {
|
||||
|
@ -1,20 +1,20 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local request = helpers.request
|
||||
local eq = helpers.eq
|
||||
local ok = helpers.ok
|
||||
local pcall_err = helpers.pcall_err
|
||||
local insert = helpers.insert
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local exec = helpers.exec
|
||||
local api = helpers.api
|
||||
local assert_alive = helpers.assert_alive
|
||||
local request = t.request
|
||||
local eq = t.eq
|
||||
local ok = t.ok
|
||||
local pcall_err = t.pcall_err
|
||||
local insert = t.insert
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local exec = t.exec
|
||||
local api = t.api
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
local function expect(contents)
|
||||
return eq(contents, helpers.curbuf_contents())
|
||||
return eq(contents, t.curbuf_contents())
|
||||
end
|
||||
|
||||
local function set_extmark(ns_id, id, line, col, opts)
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local eq, eval = helpers.eq, helpers.eval
|
||||
local command = helpers.command
|
||||
local exec_capture = helpers.exec_capture
|
||||
local api = helpers.api
|
||||
local fn = helpers.fn
|
||||
local pcall_err = helpers.pcall_err
|
||||
local ok = helpers.ok
|
||||
local assert_alive = helpers.assert_alive
|
||||
local eq, eval = t.eq, t.eval
|
||||
local command = t.command
|
||||
local exec_capture = t.exec_capture
|
||||
local api = t.api
|
||||
local fn = t.fn
|
||||
local pcall_err = t.pcall_err
|
||||
local ok = t.ok
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('API: highlight', function()
|
||||
clear()
|
||||
|
@ -1,17 +1,17 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq, neq = helpers.eq, helpers.neq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local source = helpers.source
|
||||
local pcall_err = helpers.pcall_err
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq, neq = t.eq, t.neq
|
||||
local exec_lua = t.exec_lua
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local source = t.source
|
||||
local pcall_err = t.pcall_err
|
||||
|
||||
local shallowcopy = helpers.shallowcopy
|
||||
local shallowcopy = t.shallowcopy
|
||||
local sleep = vim.uv.sleep
|
||||
|
||||
local sid_api_client = -9
|
||||
@ -1114,7 +1114,7 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
|
||||
feed('asdf\n')
|
||||
|
||||
eq(1, exec_lua [[return GlobalCount]])
|
||||
eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
|
||||
eq('\nNo mapping found', t.exec_capture('nmap asdf'))
|
||||
end)
|
||||
|
||||
it('no double-free when unmapping simplifiable lua mappings', function()
|
||||
@ -1138,13 +1138,13 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
|
||||
feed('<C-I>\n')
|
||||
|
||||
eq(1, exec_lua [[return GlobalCount]])
|
||||
eq('\nNo mapping found', helpers.exec_capture('nmap <C-I>'))
|
||||
eq('\nNo mapping found', t.exec_capture('nmap <C-I>'))
|
||||
end)
|
||||
|
||||
it('can set descriptions on mappings', function()
|
||||
api.nvim_set_keymap('n', 'lhs', 'rhs', { desc = 'map description' })
|
||||
eq(generate_mapargs('n', 'lhs', 'rhs', { desc = 'map description' }), get_mapargs('n', 'lhs'))
|
||||
eq('\nn lhs rhs\n map description', helpers.exec_capture('nmap lhs'))
|
||||
eq('\nn lhs rhs\n map description', t.exec_capture('nmap lhs'))
|
||||
end)
|
||||
|
||||
it('can define !-mode abbreviations with lua callbacks', function()
|
||||
@ -1290,7 +1290,7 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function()
|
||||
|
||||
it('does not crash when setting mapping in a non-existing buffer #13541', function()
|
||||
pcall_err(api.nvim_buf_set_keymap, 100, '', 'lsh', 'irhs<Esc>', {})
|
||||
helpers.assert_alive()
|
||||
t.assert_alive()
|
||||
end)
|
||||
|
||||
it('can make lua mappings', function()
|
||||
@ -1372,7 +1372,7 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function()
|
||||
feed('asdf\n')
|
||||
|
||||
eq(1, exec_lua [[return GlobalCount]])
|
||||
eq('\nNo mapping found', helpers.exec_capture('nmap asdf'))
|
||||
eq('\nNo mapping found', t.exec_capture('nmap asdf'))
|
||||
end)
|
||||
|
||||
it('no double-free when unmapping simplifiable lua mappings', function()
|
||||
@ -1396,6 +1396,6 @@ describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function()
|
||||
feed('<C-I>\n')
|
||||
|
||||
eq(1, exec_lua [[return GlobalCount]])
|
||||
eq('\nNo mapping found', helpers.exec_capture('nmap <C-I>'))
|
||||
eq('\nNo mapping found', t.exec_capture('nmap <C-I>'))
|
||||
end)
|
||||
end)
|
||||
|
@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local feed = t.feed
|
||||
|
||||
describe('update_menu notification', function()
|
||||
local screen
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local neq = helpers.neq
|
||||
local nvim_argv = helpers.nvim_argv
|
||||
local request = helpers.request
|
||||
local retry = helpers.retry
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local neq = t.neq
|
||||
local nvim_argv = t.nvim_argv
|
||||
local request = t.request
|
||||
local retry = t.retry
|
||||
local NIL = vim.NIL
|
||||
local is_os = helpers.is_os
|
||||
local is_os = t.is_os
|
||||
|
||||
describe('API', function()
|
||||
before_each(clear)
|
||||
|
@ -1,12 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local assert_log = helpers.assert_log
|
||||
local eq, clear, eval, command, next_msg =
|
||||
helpers.eq, helpers.clear, helpers.eval, helpers.command, helpers.next_msg
|
||||
local api = helpers.api
|
||||
local exec_lua = helpers.exec_lua
|
||||
local retry = helpers.retry
|
||||
local assert_alive = helpers.assert_alive
|
||||
local check_close = helpers.check_close
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
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
|
||||
local exec_lua = t.exec_lua
|
||||
local retry = t.retry
|
||||
local assert_alive = t.assert_alive
|
||||
local check_close = t.check_close
|
||||
|
||||
local testlog = 'Xtest-server-notify-log'
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
-- Test server -> client RPC scenarios. Note: unlike `rpcnotify`, to evaluate
|
||||
-- `rpcrequest` calls we need the client event loop to be running.
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear, eval = helpers.clear, helpers.eval
|
||||
local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop
|
||||
local nvim_prog, command, fn = helpers.nvim_prog, helpers.command, helpers.fn
|
||||
local source, next_msg = helpers.source, helpers.next_msg
|
||||
local ok = helpers.ok
|
||||
local api = helpers.api
|
||||
local spawn, merge_args = helpers.spawn, helpers.merge_args
|
||||
local set_session = helpers.set_session
|
||||
local pcall_err = helpers.pcall_err
|
||||
local assert_alive = helpers.assert_alive
|
||||
local clear, eval = t.clear, t.eval
|
||||
local eq, neq, run, stop = t.eq, t.neq, t.run, t.stop
|
||||
local nvim_prog, command, fn = t.nvim_prog, t.command, t.fn
|
||||
local source, next_msg = t.source, t.next_msg
|
||||
local ok = t.ok
|
||||
local api = t.api
|
||||
local spawn, merge_args = t.spawn, t.merge_args
|
||||
local set_session = t.set_session
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('server -> client', function()
|
||||
local cid
|
||||
@ -259,7 +259,7 @@ describe('server -> client', function()
|
||||
pcall(fn.jobstop, jobid)
|
||||
end)
|
||||
|
||||
if helpers.skip(helpers.is_os('win')) then
|
||||
if t.skip(t.is_os('win')) then
|
||||
return
|
||||
end
|
||||
|
||||
@ -280,7 +280,7 @@ describe('server -> client', function()
|
||||
end)
|
||||
|
||||
describe('connecting to another (peer) nvim', function()
|
||||
local nvim_argv = merge_args(helpers.nvim_argv, { '--headless' })
|
||||
local nvim_argv = merge_args(t.nvim_argv, { '--headless' })
|
||||
local function connect_test(server, mode, address)
|
||||
local serverpid = fn.getpid()
|
||||
local client = spawn(nvim_argv, false, nil, true)
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, eq, ok = helpers.clear, helpers.eq, helpers.ok
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local fn = helpers.fn
|
||||
local request = helpers.request
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, eq, ok = t.clear, t.eq, t.ok
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local fn = t.fn
|
||||
local request = t.request
|
||||
local NIL = vim.NIL
|
||||
local pcall_err = helpers.pcall_err
|
||||
local command = helpers.command
|
||||
local pcall_err = t.pcall_err
|
||||
local command = t.command
|
||||
|
||||
describe('api/tabpage', function()
|
||||
before_each(clear)
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local request = helpers.request
|
||||
local pcall_err = helpers.pcall_err
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local request = t.request
|
||||
local pcall_err = t.pcall_err
|
||||
|
||||
describe('nvim_ui_attach()', function()
|
||||
before_each(function()
|
||||
|
@ -1,6 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, fn, eq = helpers.clear, helpers.fn, helpers.eq
|
||||
local api = helpers.api
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, fn, eq = t.clear, t.fn, t.eq
|
||||
local api = t.api
|
||||
|
||||
local function read_mpack_file(fname)
|
||||
local fd = io.open(fname, 'rb')
|
||||
|
@ -1,42 +1,42 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local uv = vim.uv
|
||||
|
||||
local fmt = string.format
|
||||
local dedent = helpers.dedent
|
||||
local assert_alive = helpers.assert_alive
|
||||
local dedent = t.dedent
|
||||
local assert_alive = t.assert_alive
|
||||
local NIL = vim.NIL
|
||||
local clear, eq, neq = helpers.clear, helpers.eq, helpers.neq
|
||||
local command = helpers.command
|
||||
local command_output = helpers.api.nvim_command_output
|
||||
local exec = helpers.exec
|
||||
local exec_capture = helpers.exec_capture
|
||||
local eval = helpers.eval
|
||||
local expect = helpers.expect
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local matches = helpers.matches
|
||||
local clear, eq, neq = t.clear, t.eq, t.neq
|
||||
local command = t.command
|
||||
local command_output = t.api.nvim_command_output
|
||||
local exec = t.exec
|
||||
local exec_capture = t.exec_capture
|
||||
local eval = t.eval
|
||||
local expect = t.expect
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local matches = t.matches
|
||||
local pesc = vim.pesc
|
||||
local mkdir_p = helpers.mkdir_p
|
||||
local ok, nvim_async, feed = helpers.ok, helpers.nvim_async, helpers.feed
|
||||
local async_meths = helpers.async_meths
|
||||
local is_os = helpers.is_os
|
||||
local parse_context = helpers.parse_context
|
||||
local request = helpers.request
|
||||
local rmdir = helpers.rmdir
|
||||
local source = helpers.source
|
||||
local next_msg = helpers.next_msg
|
||||
local tmpname = helpers.tmpname
|
||||
local write_file = helpers.write_file
|
||||
local exec_lua = helpers.exec_lua
|
||||
local exc_exec = helpers.exc_exec
|
||||
local insert = helpers.insert
|
||||
local skip = helpers.skip
|
||||
local mkdir_p = t.mkdir_p
|
||||
local ok, nvim_async, feed = t.ok, t.nvim_async, t.feed
|
||||
local async_meths = t.async_meths
|
||||
local is_os = t.is_os
|
||||
local parse_context = t.parse_context
|
||||
local request = t.request
|
||||
local rmdir = t.rmdir
|
||||
local source = t.source
|
||||
local next_msg = t.next_msg
|
||||
local tmpname = t.tmpname
|
||||
local write_file = t.write_file
|
||||
local exec_lua = t.exec_lua
|
||||
local exc_exec = t.exc_exec
|
||||
local insert = t.insert
|
||||
local skip = t.skip
|
||||
|
||||
local pcall_err = helpers.pcall_err
|
||||
local pcall_err = t.pcall_err
|
||||
local format_string = require('test.format_string').format_string
|
||||
local intchar2lua = helpers.intchar2lua
|
||||
local mergedicts_copy = helpers.mergedicts_copy
|
||||
local intchar2lua = t.intchar2lua
|
||||
local mergedicts_copy = t.mergedicts_copy
|
||||
local endswith = vim.endswith
|
||||
|
||||
describe('API', function()
|
||||
@ -702,12 +702,12 @@ describe('API', function()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
helpers.rmdir('Xtestdir')
|
||||
t.rmdir('Xtestdir')
|
||||
end)
|
||||
|
||||
it('works', function()
|
||||
api.nvim_set_current_dir('Xtestdir')
|
||||
eq(start_dir .. helpers.get_pathsep() .. 'Xtestdir', fn.getcwd())
|
||||
eq(start_dir .. t.get_pathsep() .. 'Xtestdir', fn.getcwd())
|
||||
end)
|
||||
|
||||
it('sets previous directory', function()
|
||||
@ -1467,7 +1467,7 @@ describe('API', function()
|
||||
eq(NIL, api.nvim_get_var('Unknown_script_func'))
|
||||
|
||||
-- Check if autoload works properly
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
local xconfig = 'Xhome' .. pathsep .. 'Xconfig'
|
||||
local xdata = 'Xhome' .. pathsep .. 'Xdata'
|
||||
local autoload_folder = table.concat({ xconfig, 'nvim', 'autoload' }, pathsep)
|
||||
@ -1951,7 +1951,7 @@ describe('API', function()
|
||||
|
||||
describe('RPC (K_EVENT)', function()
|
||||
it('does not complete ("interrupt") normal-mode operator-pending #6166', function()
|
||||
helpers.insert([[
|
||||
t.insert([[
|
||||
FIRST LINE
|
||||
SECOND LINE]])
|
||||
api.nvim_input('gg')
|
||||
@ -1988,7 +1988,7 @@ describe('API', function()
|
||||
|
||||
it('does not complete ("interrupt") normal-mode map-pending #6166', function()
|
||||
command("nnoremap dd :let g:foo='it worked...'<CR>")
|
||||
helpers.insert([[
|
||||
t.insert([[
|
||||
FIRST LINE
|
||||
SECOND LINE]])
|
||||
api.nvim_input('gg')
|
||||
@ -2000,13 +2000,13 @@ describe('API', function()
|
||||
expect([[
|
||||
FIRST LINE
|
||||
SECOND LINE]])
|
||||
eq('it worked...', helpers.eval('g:foo'))
|
||||
eq('it worked...', t.eval('g:foo'))
|
||||
end)
|
||||
|
||||
it('does not complete ("interrupt") insert-mode map-pending #6166', function()
|
||||
command('inoremap xx foo')
|
||||
command('set timeoutlen=9999')
|
||||
helpers.insert([[
|
||||
t.insert([[
|
||||
FIRST LINE
|
||||
SECOND LINE]])
|
||||
api.nvim_input('ix')
|
||||
@ -2153,35 +2153,32 @@ describe('API', function()
|
||||
|
||||
describe('nvim_replace_termcodes', function()
|
||||
it('escapes K_SPECIAL as K_SPECIAL KS_SPECIAL KE_FILLER', function()
|
||||
eq('\128\254X', helpers.api.nvim_replace_termcodes('\128', true, true, true))
|
||||
eq('\128\254X', t.api.nvim_replace_termcodes('\128', true, true, true))
|
||||
end)
|
||||
|
||||
it('leaves non-K_SPECIAL string unchanged', function()
|
||||
eq('abc', helpers.api.nvim_replace_termcodes('abc', true, true, true))
|
||||
eq('abc', t.api.nvim_replace_termcodes('abc', true, true, true))
|
||||
end)
|
||||
|
||||
it('converts <expressions>', function()
|
||||
eq('\\', helpers.api.nvim_replace_termcodes('<Leader>', true, true, true))
|
||||
eq('\\', t.api.nvim_replace_termcodes('<Leader>', true, true, true))
|
||||
end)
|
||||
|
||||
it('converts <LeftMouse> to K_SPECIAL KS_EXTRA KE_LEFTMOUSE', function()
|
||||
-- K_SPECIAL KS_EXTRA KE_LEFTMOUSE
|
||||
-- 0x80 0xfd 0x2c
|
||||
-- 128 253 44
|
||||
eq('\128\253\44', helpers.api.nvim_replace_termcodes('<LeftMouse>', true, true, true))
|
||||
eq('\128\253\44', t.api.nvim_replace_termcodes('<LeftMouse>', true, true, true))
|
||||
end)
|
||||
|
||||
it('converts keycodes', function()
|
||||
eq(
|
||||
'\nx\27x\rx<x',
|
||||
helpers.api.nvim_replace_termcodes('<NL>x<Esc>x<CR>x<lt>x', true, true, true)
|
||||
)
|
||||
eq('\nx\27x\rx<x', t.api.nvim_replace_termcodes('<NL>x<Esc>x<CR>x<lt>x', true, true, true))
|
||||
end)
|
||||
|
||||
it('does not convert keycodes if special=false', function()
|
||||
eq(
|
||||
'<NL>x<Esc>x<CR>x<lt>x',
|
||||
helpers.api.nvim_replace_termcodes('<NL>x<Esc>x<CR>x<lt>x', true, true, false)
|
||||
t.api.nvim_replace_termcodes('<NL>x<Esc>x<CR>x<lt>x', true, true, false)
|
||||
)
|
||||
end)
|
||||
|
||||
@ -2210,18 +2207,18 @@ describe('API', function()
|
||||
api.nvim_feedkeys(':let x1="…"\n', '', true)
|
||||
|
||||
-- Both nvim_replace_termcodes and nvim_feedkeys escape \x80
|
||||
local inp = helpers.api.nvim_replace_termcodes(':let x2="…"<CR>', true, true, true)
|
||||
local inp = t.api.nvim_replace_termcodes(':let x2="…"<CR>', true, true, true)
|
||||
api.nvim_feedkeys(inp, '', true) -- escape_ks=true
|
||||
|
||||
-- nvim_feedkeys with K_SPECIAL escaping disabled
|
||||
inp = helpers.api.nvim_replace_termcodes(':let x3="…"<CR>', true, true, true)
|
||||
inp = t.api.nvim_replace_termcodes(':let x3="…"<CR>', true, true, true)
|
||||
api.nvim_feedkeys(inp, '', false) -- escape_ks=false
|
||||
|
||||
helpers.stop()
|
||||
t.stop()
|
||||
end
|
||||
|
||||
-- spin the loop a bit
|
||||
helpers.run(nil, nil, on_setup)
|
||||
t.run(nil, nil, on_setup)
|
||||
|
||||
eq('…', api.nvim_get_var('x1'))
|
||||
-- Because of the double escaping this is neq
|
||||
@ -2364,7 +2361,7 @@ describe('API', function()
|
||||
{0:~ }|*6
|
||||
{1:very fail} |
|
||||
]])
|
||||
helpers.poke_eventloop()
|
||||
t.poke_eventloop()
|
||||
|
||||
-- shows up to &cmdheight lines
|
||||
async_meths.nvim_err_write('more fail\ntoo fail\n')
|
||||
@ -2676,7 +2673,7 @@ describe('API', function()
|
||||
|
||||
describe('nvim_list_runtime_paths', function()
|
||||
setup(function()
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
mkdir_p('Xtest' .. pathsep .. 'a')
|
||||
mkdir_p('Xtest' .. pathsep .. 'b')
|
||||
end)
|
||||
@ -3183,7 +3180,7 @@ describe('API', function()
|
||||
end)
|
||||
|
||||
describe('nvim_get_runtime_file', function()
|
||||
local p = helpers.alter_slashes
|
||||
local p = t.alter_slashes
|
||||
it('can find files', function()
|
||||
eq({}, api.nvim_get_runtime_file('bork.borkbork', false))
|
||||
eq({}, api.nvim_get_runtime_file('bork.borkbork', true))
|
||||
@ -3410,13 +3407,13 @@ describe('API', function()
|
||||
{desc="(global option, fallback requested) points to global", linenr=9, sid=1, args={'completeopt', {}}},
|
||||
}
|
||||
|
||||
for _, t in pairs(tests) do
|
||||
it(t.desc, function()
|
||||
for _, test in pairs(tests) do
|
||||
it(test.desc, function()
|
||||
-- Switch to the target buffer/window so that curbuf/curwin are used.
|
||||
api.nvim_set_current_win(wins[2])
|
||||
local info = api.nvim_get_option_info2(unpack(t.args))
|
||||
eq(t.linenr, info.last_set_linenr)
|
||||
eq(t.sid, info.last_set_sid)
|
||||
local info = api.nvim_get_option_info2(unpack(test.args))
|
||||
eq(test.linenr, info.last_set_linenr)
|
||||
eq(test.sid, info.last_set_sid)
|
||||
end)
|
||||
end
|
||||
|
||||
@ -3537,9 +3534,9 @@ describe('API', function()
|
||||
false,
|
||||
{ width = 79, height = 31, row = 1, col = 1, relative = 'editor' }
|
||||
)
|
||||
local t = api.nvim_open_term(b, {})
|
||||
local term = api.nvim_open_term(b, {})
|
||||
|
||||
api.nvim_chan_send(t, io.open('test/functional/fixtures/smile2.cat', 'r'):read('*a'))
|
||||
api.nvim_chan_send(term, io.open('test/functional/fixtures/smile2.cat', 'r'):read('*a'))
|
||||
screen:expect {
|
||||
grid = [[
|
||||
^ |
|
||||
|
@ -1,27 +1,27 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, curbuf, curbuf_contents, curwin, eq, neq, matches, ok, feed, insert, eval =
|
||||
helpers.clear,
|
||||
helpers.api.nvim_get_current_buf,
|
||||
helpers.curbuf_contents,
|
||||
helpers.api.nvim_get_current_win,
|
||||
helpers.eq,
|
||||
helpers.neq,
|
||||
helpers.matches,
|
||||
helpers.ok,
|
||||
helpers.feed,
|
||||
helpers.insert,
|
||||
helpers.eval
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local exec = helpers.exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
local fn = helpers.fn
|
||||
local request = helpers.request
|
||||
t.clear,
|
||||
t.api.nvim_get_current_buf,
|
||||
t.curbuf_contents,
|
||||
t.api.nvim_get_current_win,
|
||||
t.eq,
|
||||
t.neq,
|
||||
t.matches,
|
||||
t.ok,
|
||||
t.feed,
|
||||
t.insert,
|
||||
t.eval
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
local exec = t.exec
|
||||
local exec_lua = t.exec_lua
|
||||
local fn = t.fn
|
||||
local request = t.request
|
||||
local NIL = vim.NIL
|
||||
local api = helpers.api
|
||||
local command = helpers.command
|
||||
local pcall_err = helpers.pcall_err
|
||||
local assert_alive = helpers.assert_alive
|
||||
local api = t.api
|
||||
local command = t.command
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('API/win', function()
|
||||
before_each(clear)
|
||||
@ -1297,7 +1297,7 @@ describe('API/win', function()
|
||||
local tab1 = api.nvim_get_current_tabpage()
|
||||
local tab1_win = api.nvim_get_current_win()
|
||||
|
||||
helpers.command('tabnew')
|
||||
t.command('tabnew')
|
||||
local tab2 = api.nvim_get_current_tabpage()
|
||||
local tab2_win = api.nvim_get_current_win()
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local api = helpers.api
|
||||
local fn = helpers.fn
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local assert_log = helpers.assert_log
|
||||
local check_close = helpers.check_close
|
||||
local is_os = helpers.is_os
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local api = t.api
|
||||
local fn = t.fn
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local assert_log = t.assert_log
|
||||
local check_close = t.check_close
|
||||
local is_os = t.is_os
|
||||
|
||||
local testlog = 'Xtest_autocmd_oldtest_log'
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local assert_visible = helpers.assert_visible
|
||||
local assert_alive = helpers.assert_alive
|
||||
local dedent = helpers.dedent
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local matches = helpers.matches
|
||||
local api = helpers.api
|
||||
local pcall_err = helpers.pcall_err
|
||||
local fn = helpers.fn
|
||||
local expect = helpers.expect
|
||||
local command = helpers.command
|
||||
local exc_exec = helpers.exc_exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
local retry = helpers.retry
|
||||
local source = helpers.source
|
||||
local assert_visible = t.assert_visible
|
||||
local assert_alive = t.assert_alive
|
||||
local dedent = t.dedent
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
local matches = t.matches
|
||||
local api = t.api
|
||||
local pcall_err = t.pcall_err
|
||||
local fn = t.fn
|
||||
local expect = t.expect
|
||||
local command = t.command
|
||||
local exc_exec = t.exc_exec
|
||||
local exec_lua = t.exec_lua
|
||||
local retry = t.retry
|
||||
local source = t.source
|
||||
|
||||
describe('autocmd', function()
|
||||
before_each(clear)
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local request = helpers.request
|
||||
local source = helpers.source
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local request = t.request
|
||||
local source = t.source
|
||||
|
||||
describe('autocmd BufEnter', function()
|
||||
before_each(clear)
|
||||
@ -33,7 +33,7 @@ describe('autocmd BufEnter', function()
|
||||
end)
|
||||
|
||||
it('triggered by ":split normal|:help|:bw"', function()
|
||||
helpers.add_builddir_to_rtp()
|
||||
t.add_builddir_to_rtp()
|
||||
command('split normal')
|
||||
command('wincmd j')
|
||||
command('help')
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local source = helpers.source
|
||||
local request = helpers.request
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local source = t.source
|
||||
local request = t.request
|
||||
|
||||
describe('BufModified', function()
|
||||
before_each(clear)
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local expect = helpers.expect
|
||||
local eval = helpers.eval
|
||||
local next_msg = helpers.next_msg
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local expect = t.expect
|
||||
local eval = t.eval
|
||||
local next_msg = t.next_msg
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
|
||||
describe('cmdline autocommands', function()
|
||||
local channel
|
||||
|
@ -1,12 +1,12 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local feed = helpers.feed
|
||||
local retry = helpers.retry
|
||||
local exec = helpers.source
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local feed = t.feed
|
||||
local retry = t.retry
|
||||
local exec = t.source
|
||||
local sleep = vim.uv.sleep
|
||||
local api = helpers.api
|
||||
local api = t.api
|
||||
|
||||
before_each(clear)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local api = helpers.api
|
||||
local source = helpers.source
|
||||
local command = helpers.command
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local api = t.api
|
||||
local source = t.source
|
||||
local command = t.command
|
||||
|
||||
describe('CursorMoved', function()
|
||||
before_each(clear)
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local request = helpers.request
|
||||
local is_os = helpers.is_os
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local request = t.request
|
||||
local is_os = t.is_os
|
||||
|
||||
describe('autocmd DirChanged and DirChangedPre', function()
|
||||
local curdir = vim.uv.cwd():gsub('\\', '/')
|
||||
@ -22,12 +22,12 @@ describe('autocmd DirChanged and DirChangedPre', function()
|
||||
|
||||
setup(function()
|
||||
for _, dir in pairs(dirs) do
|
||||
helpers.mkdir(dir)
|
||||
t.mkdir(dir)
|
||||
end
|
||||
end)
|
||||
teardown(function()
|
||||
for _, dir in pairs(dirs) do
|
||||
helpers.rmdir(dir)
|
||||
t.rmdir(dir)
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eval = helpers.eval
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eval = t.eval
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
|
||||
describe('autocmd FileType', function()
|
||||
before_each(clear)
|
||||
|
||||
it('is triggered by :help only once', function()
|
||||
helpers.add_builddir_to_rtp()
|
||||
t.add_builddir_to_rtp()
|
||||
command('let g:foo = 0')
|
||||
command('autocmd FileType help let g:foo = g:foo + 1')
|
||||
command('help help')
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local thelpers = require('test.functional.terminal.helpers')
|
||||
local clear = helpers.clear
|
||||
local feed_command = helpers.feed_command
|
||||
local feed_data = thelpers.feed_data
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local tt = require('test.functional.terminal.testutil')
|
||||
local clear = t.clear
|
||||
local feed_command = t.feed_command
|
||||
local feed_data = tt.feed_data
|
||||
|
||||
if helpers.skip(helpers.is_os('win')) then
|
||||
if t.skip(t.is_os('win')) then
|
||||
return
|
||||
end
|
||||
|
||||
@ -14,7 +14,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = thelpers.setup_child_nvim({
|
||||
screen = tt.setup_child_nvim({
|
||||
'-u',
|
||||
'NONE',
|
||||
'-i',
|
||||
@ -39,7 +39,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
||||
line 4
|
||||
]]
|
||||
|
||||
helpers.write_file(path, '')
|
||||
t.write_file(path, '')
|
||||
local atime = os.time() - 10
|
||||
vim.uv.fs_utime(path, atime, atime)
|
||||
|
||||
@ -75,7 +75,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
|
||||
unchanged = true,
|
||||
}
|
||||
|
||||
helpers.write_file(path, expected_addition)
|
||||
t.write_file(path, expected_addition)
|
||||
|
||||
feed_data('\027[I')
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq
|
||||
local feed, command = helpers.feed, helpers.command
|
||||
local exec_lua = helpers.exec_lua
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, eval, eq = t.clear, t.eval, t.eq
|
||||
local feed, command = t.feed, t.command
|
||||
local exec_lua = t.exec_lua
|
||||
|
||||
describe('ModeChanged', function()
|
||||
before_each(function()
|
||||
|
@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local source_vim = helpers.source
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local source_vim = t.source
|
||||
|
||||
describe('RecordingEnter', function()
|
||||
before_each(clear)
|
||||
|
@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
|
||||
before_each(clear)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local api = helpers.api
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local api = t.api
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
|
||||
describe('autocmd SearchWrapped', function()
|
||||
before_each(function()
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local dedent = helpers.dedent
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local eval = helpers.eval
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local dedent = t.dedent
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local eval = t.eval
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
|
||||
describe(':autocmd', function()
|
||||
before_each(function()
|
||||
|
@ -1,12 +1,12 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local next_msg = helpers.next_msg
|
||||
local is_os = helpers.is_os
|
||||
local skip = helpers.skip
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local next_msg = t.next_msg
|
||||
local is_os = t.is_os
|
||||
local skip = t.skip
|
||||
|
||||
if skip(is_os('win'), 'Only applies to POSIX systems') then
|
||||
return
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, eq = helpers.clear, helpers.eq
|
||||
local api = helpers.api
|
||||
local command = helpers.command
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, eq = t.clear, t.eq
|
||||
local api = t.api
|
||||
local command = t.command
|
||||
|
||||
describe('TabClosed', function()
|
||||
before_each(clear)
|
||||
|
@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
|
||||
describe('autocmd TabNew', function()
|
||||
before_each(clear)
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local dedent = helpers.dedent
|
||||
local eval = helpers.eval
|
||||
local eq = helpers.eq
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local exec_capture = helpers.exec_capture
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local dedent = t.dedent
|
||||
local eval = t.eval
|
||||
local eq = t.eq
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local exec_capture = t.exec_capture
|
||||
|
||||
describe('TabNewEntered', function()
|
||||
describe('au TabNewEntered', function()
|
||||
|
@ -1,17 +1,17 @@
|
||||
local uv = vim.uv
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local thelpers = require('test.functional.terminal.helpers')
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local tt = require('test.functional.terminal.testutil')
|
||||
|
||||
local clear, command, testprg = helpers.clear, helpers.command, helpers.testprg
|
||||
local eval, eq, neq, retry = helpers.eval, helpers.eq, helpers.neq, helpers.retry
|
||||
local matches = helpers.matches
|
||||
local ok = helpers.ok
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local pcall_err = helpers.pcall_err
|
||||
local assert_alive = helpers.assert_alive
|
||||
local skip = helpers.skip
|
||||
local is_os = helpers.is_os
|
||||
local clear, command, testprg = t.clear, t.command, t.testprg
|
||||
local eval, eq, neq, retry = t.eval, t.eq, t.neq, t.retry
|
||||
local matches = t.matches
|
||||
local ok = t.ok
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = t.assert_alive
|
||||
local skip = t.skip
|
||||
local is_os = t.is_os
|
||||
|
||||
describe('autocmd TermClose', function()
|
||||
before_each(function()
|
||||
@ -198,11 +198,11 @@ end)
|
||||
|
||||
describe('autocmd TextChangedT', function()
|
||||
clear()
|
||||
local screen = thelpers.screen_setup()
|
||||
local screen = tt.screen_setup()
|
||||
|
||||
it('works', function()
|
||||
command('autocmd TextChangedT * ++once let g:called = 1')
|
||||
thelpers.feed_data('a')
|
||||
tt.feed_data('a')
|
||||
retry(nil, nil, function()
|
||||
eq(1, api.nvim_get_var('called'))
|
||||
end)
|
||||
@ -210,7 +210,7 @@ describe('autocmd TextChangedT', function()
|
||||
|
||||
it('cannot delete terminal buffer', function()
|
||||
command([[autocmd TextChangedT * call nvim_input('<CR>') | bwipe!]])
|
||||
thelpers.feed_data('a')
|
||||
tt.feed_data('a')
|
||||
screen:expect({ any = 'E937: ' })
|
||||
matches(
|
||||
'^E937: Attempt to delete a buffer that is in use: term://',
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local exec = helpers.exec
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local eval = helpers.eval
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local write_file = helpers.write_file
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local exec = t.exec
|
||||
local command = t.command
|
||||
local feed = t.feed
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local eval = t.eval
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
local write_file = t.write_file
|
||||
|
||||
-- oldtest: Test_ChangedP()
|
||||
it('TextChangedI and TextChangedP autocommands', function()
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq
|
||||
local feed, command, expect = helpers.feed, helpers.command, helpers.expect
|
||||
local api, fn, neq = helpers.api, helpers.fn, helpers.neq
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
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
|
||||
|
||||
describe('TextYankPost', function()
|
||||
before_each(function()
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local exec = helpers.exec
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local assert_alive = helpers.assert_alive
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local exec = t.exec
|
||||
local command = t.command
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
before_each(clear)
|
||||
|
||||
|
@ -1,18 +1,17 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, eq, eval, next_msg, ok, source =
|
||||
helpers.clear, helpers.eq, helpers.eval, helpers.next_msg, helpers.ok, helpers.source
|
||||
local command, fn, api = helpers.command, helpers.fn, helpers.api
|
||||
local matches = helpers.matches
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
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
|
||||
local sleep = vim.uv.sleep
|
||||
local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv
|
||||
local get_session, set_session = helpers.get_session, helpers.set_session
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local is_os = helpers.is_os
|
||||
local retry = helpers.retry
|
||||
local expect_twostreams = helpers.expect_twostreams
|
||||
local assert_alive = helpers.assert_alive
|
||||
local pcall_err = helpers.pcall_err
|
||||
local skip = helpers.skip
|
||||
local spawn, nvim_argv = t.spawn, t.nvim_argv
|
||||
local get_session, set_session = t.get_session, t.set_session
|
||||
local nvim_prog = t.nvim_prog
|
||||
local is_os = t.is_os
|
||||
local retry = t.retry
|
||||
local expect_twostreams = t.expect_twostreams
|
||||
local assert_alive = t.assert_alive
|
||||
local pcall_err = t.pcall_err
|
||||
local skip = t.skip
|
||||
|
||||
describe('channels', function()
|
||||
local init = [[
|
||||
|
@ -1,24 +1,24 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local assert_alive = helpers.assert_alive
|
||||
local command = helpers.command
|
||||
local feed_command = helpers.feed_command
|
||||
local feed = helpers.feed
|
||||
local eval = helpers.eval
|
||||
local eq = helpers.eq
|
||||
local run = helpers.run
|
||||
local fn = helpers.fn
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local pcall_err = helpers.pcall_err
|
||||
local exec_capture = helpers.exec_capture
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local assert_alive = t.assert_alive
|
||||
local command = t.command
|
||||
local feed_command = t.feed_command
|
||||
local feed = t.feed
|
||||
local eval = t.eval
|
||||
local eq = t.eq
|
||||
local run = t.run
|
||||
local fn = t.fn
|
||||
local nvim_prog = t.nvim_prog
|
||||
local pcall_err = t.pcall_err
|
||||
local exec_capture = t.exec_capture
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
|
||||
describe('v:exiting', function()
|
||||
local cid
|
||||
|
||||
before_each(function()
|
||||
helpers.clear()
|
||||
cid = helpers.api.nvim_get_chan_info(0).id
|
||||
t.clear()
|
||||
cid = t.api.nvim_get_chan_info(0).id
|
||||
end)
|
||||
|
||||
it('defaults to v:null', function()
|
||||
@ -74,7 +74,7 @@ describe(':cquit', function()
|
||||
end
|
||||
|
||||
before_each(function()
|
||||
helpers.clear()
|
||||
t.clear()
|
||||
end)
|
||||
|
||||
it('exits with non-zero after :cquit', function()
|
||||
|
@ -1,37 +1,37 @@
|
||||
local uv = vim.uv
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local assert_log = helpers.assert_log
|
||||
local assert_nolog = helpers.assert_nolog
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local ok = helpers.ok
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local request = helpers.request
|
||||
local retry = helpers.retry
|
||||
local rmdir = helpers.rmdir
|
||||
local matches = helpers.matches
|
||||
local api = helpers.api
|
||||
local mkdir = helpers.mkdir
|
||||
local assert_log = t.assert_log
|
||||
local assert_nolog = t.assert_nolog
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local ok = t.ok
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
local nvim_prog = t.nvim_prog
|
||||
local request = t.request
|
||||
local retry = t.retry
|
||||
local rmdir = t.rmdir
|
||||
local matches = t.matches
|
||||
local api = t.api
|
||||
local mkdir = t.mkdir
|
||||
local sleep = vim.uv.sleep
|
||||
local read_file = helpers.read_file
|
||||
local read_file = t.read_file
|
||||
local trim = vim.trim
|
||||
local currentdir = helpers.fn.getcwd
|
||||
local assert_alive = helpers.assert_alive
|
||||
local check_close = helpers.check_close
|
||||
local expect_exit = helpers.expect_exit
|
||||
local write_file = helpers.write_file
|
||||
local currentdir = t.fn.getcwd
|
||||
local assert_alive = t.assert_alive
|
||||
local check_close = t.check_close
|
||||
local expect_exit = t.expect_exit
|
||||
local write_file = t.write_file
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local feed_command = helpers.feed_command
|
||||
local skip = helpers.skip
|
||||
local is_os = helpers.is_os
|
||||
local is_ci = helpers.is_ci
|
||||
local spawn = helpers.spawn
|
||||
local set_session = helpers.set_session
|
||||
local feed_command = t.feed_command
|
||||
local skip = t.skip
|
||||
local is_os = t.is_os
|
||||
local is_ci = t.is_ci
|
||||
local spawn = t.spawn
|
||||
local set_session = t.set_session
|
||||
|
||||
describe('fileio', function()
|
||||
before_each(function() end)
|
||||
@ -228,7 +228,7 @@ describe('fileio', function()
|
||||
|
||||
local initial_content = 'foo'
|
||||
local backup_dir = 'Xtest_backupdir'
|
||||
local sep = helpers.get_pathsep()
|
||||
local sep = t.get_pathsep()
|
||||
local link_file_name = 'Xtest_startup_file2'
|
||||
local backup_file_name = backup_dir .. sep .. link_file_name .. '~'
|
||||
|
||||
@ -329,7 +329,7 @@ describe('tmpdir', function()
|
||||
|
||||
before_each(function()
|
||||
-- Fake /tmp dir so that we can mess it up.
|
||||
os_tmpdir = vim.uv.fs_mkdtemp(vim.fs.dirname(helpers.tmpname()) .. '/nvim_XXXXXXXXXX')
|
||||
os_tmpdir = vim.uv.fs_mkdtemp(vim.fs.dirname(t.tmpname()) .. '/nvim_XXXXXXXXXX')
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
|
@ -1,40 +1,40 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local thelpers = require('test.functional.terminal.helpers')
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local tt = require('test.functional.terminal.testutil')
|
||||
|
||||
local clear = helpers.clear
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local exc_exec = helpers.exc_exec
|
||||
local feed_command = helpers.feed_command
|
||||
local feed = helpers.feed
|
||||
local insert = helpers.insert
|
||||
local neq = helpers.neq
|
||||
local next_msg = helpers.next_msg
|
||||
local testprg = helpers.testprg
|
||||
local ok = helpers.ok
|
||||
local source = helpers.source
|
||||
local write_file = helpers.write_file
|
||||
local mkdir = helpers.mkdir
|
||||
local rmdir = helpers.rmdir
|
||||
local assert_alive = helpers.assert_alive
|
||||
local command = helpers.command
|
||||
local fn = helpers.fn
|
||||
local os_kill = helpers.os_kill
|
||||
local retry = helpers.retry
|
||||
local api = helpers.api
|
||||
local clear = t.clear
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local exc_exec = t.exc_exec
|
||||
local feed_command = t.feed_command
|
||||
local feed = t.feed
|
||||
local insert = t.insert
|
||||
local neq = t.neq
|
||||
local next_msg = t.next_msg
|
||||
local testprg = t.testprg
|
||||
local ok = t.ok
|
||||
local source = t.source
|
||||
local write_file = t.write_file
|
||||
local mkdir = t.mkdir
|
||||
local rmdir = t.rmdir
|
||||
local assert_alive = t.assert_alive
|
||||
local command = t.command
|
||||
local fn = t.fn
|
||||
local os_kill = t.os_kill
|
||||
local retry = t.retry
|
||||
local api = t.api
|
||||
local NIL = vim.NIL
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local get_pathsep = helpers.get_pathsep
|
||||
local pathroot = helpers.pathroot
|
||||
local exec_lua = helpers.exec_lua
|
||||
local nvim_set = helpers.nvim_set
|
||||
local expect_twostreams = helpers.expect_twostreams
|
||||
local expect_msg_seq = helpers.expect_msg_seq
|
||||
local pcall_err = helpers.pcall_err
|
||||
local matches = helpers.matches
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
local get_pathsep = t.get_pathsep
|
||||
local pathroot = t.pathroot
|
||||
local exec_lua = t.exec_lua
|
||||
local nvim_set = t.nvim_set
|
||||
local expect_twostreams = t.expect_twostreams
|
||||
local expect_msg_seq = t.expect_msg_seq
|
||||
local pcall_err = t.pcall_err
|
||||
local matches = t.matches
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local skip = helpers.skip
|
||||
local is_os = helpers.is_os
|
||||
local skip = t.skip
|
||||
local is_os = t.is_os
|
||||
|
||||
describe('jobs', function()
|
||||
local channel
|
||||
@ -307,7 +307,7 @@ describe('jobs', function()
|
||||
|
||||
it('preserves NULs', function()
|
||||
-- Make a file with NULs in it.
|
||||
local filename = helpers.tmpname()
|
||||
local filename = t.tmpname()
|
||||
write_file(filename, 'abc\0def\n')
|
||||
|
||||
command("let j = jobstart(['cat', '" .. filename .. "'], g:job_opts)")
|
||||
@ -732,7 +732,7 @@ describe('jobs', function()
|
||||
describe('jobwait()', function()
|
||||
before_each(function()
|
||||
if is_os('win') then
|
||||
helpers.set_shell_powershell()
|
||||
t.set_shell_powershell()
|
||||
end
|
||||
end)
|
||||
|
||||
@ -1182,7 +1182,7 @@ describe('jobs', function()
|
||||
end)
|
||||
|
||||
it('does not close the same handle twice on exit #25086', function()
|
||||
local filename = string.format('%s.lua', helpers.tmpname())
|
||||
local filename = string.format('%s.lua', t.tmpname())
|
||||
write_file(
|
||||
filename,
|
||||
[[
|
||||
@ -1195,7 +1195,7 @@ describe('jobs', function()
|
||||
]]
|
||||
)
|
||||
|
||||
local screen = thelpers.setup_child_nvim({
|
||||
local screen = tt.setup_child_nvim({
|
||||
'--cmd',
|
||||
'set notermguicolors',
|
||||
'-i',
|
||||
@ -1239,7 +1239,7 @@ describe('pty process teardown', function()
|
||||
skip(fn.executable('sleep') == 0, 'missing "sleep" command')
|
||||
-- Use a nested nvim (in :term) to test without --headless.
|
||||
fn.termopen({
|
||||
helpers.nvim_prog,
|
||||
t.nvim_prog,
|
||||
'-u',
|
||||
'NONE',
|
||||
'-i',
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local assert_log = helpers.assert_log
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local exec_lua = helpers.exec_lua
|
||||
local expect_exit = helpers.expect_exit
|
||||
local request = helpers.request
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local assert_log = t.assert_log
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local exec_lua = t.exec_lua
|
||||
local expect_exit = t.expect_exit
|
||||
local request = t.request
|
||||
|
||||
describe('log', function()
|
||||
local testlog = 'Xtest_logging'
|
||||
|
@ -1,17 +1,17 @@
|
||||
local uv = vim.uv
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local eq = helpers.eq
|
||||
local matches = helpers.matches
|
||||
local feed = helpers.feed
|
||||
local eval = helpers.eval
|
||||
local clear = helpers.clear
|
||||
local fn = helpers.fn
|
||||
local nvim_prog_abs = helpers.nvim_prog_abs
|
||||
local write_file = helpers.write_file
|
||||
local is_os = helpers.is_os
|
||||
local skip = helpers.skip
|
||||
local eq = t.eq
|
||||
local matches = t.matches
|
||||
local feed = t.feed
|
||||
local eval = t.eval
|
||||
local clear = t.clear
|
||||
local fn = t.fn
|
||||
local nvim_prog_abs = t.nvim_prog_abs
|
||||
local write_file = t.write_file
|
||||
local is_os = t.is_os
|
||||
local skip = t.skip
|
||||
|
||||
describe('command-line option', function()
|
||||
describe('-s', function()
|
||||
|
@ -1,15 +1,15 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local insert = helpers.insert
|
||||
local is_os = helpers.is_os
|
||||
local mkdir = helpers.mkdir
|
||||
local rmdir = helpers.rmdir
|
||||
local write_file = helpers.write_file
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
local insert = t.insert
|
||||
local is_os = t.is_os
|
||||
local mkdir = t.mkdir
|
||||
local rmdir = t.rmdir
|
||||
local write_file = t.write_file
|
||||
|
||||
local function join_path(...)
|
||||
local pathsep = (is_os('win') and '\\' or '/')
|
||||
|
@ -1,20 +1,20 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local exec_capture = helpers.exec_capture
|
||||
local exec_lua = helpers.exec_lua
|
||||
local expect = helpers.expect
|
||||
local fn = helpers.fn
|
||||
local insert = helpers.insert
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local new_argv = helpers.new_argv
|
||||
local neq = helpers.neq
|
||||
local set_session = helpers.set_session
|
||||
local spawn = helpers.spawn
|
||||
local tmpname = helpers.tmpname
|
||||
local write_file = helpers.write_file
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local exec_capture = t.exec_capture
|
||||
local exec_lua = t.exec_lua
|
||||
local expect = t.expect
|
||||
local fn = t.fn
|
||||
local insert = t.insert
|
||||
local nvim_prog = t.nvim_prog
|
||||
local new_argv = t.new_argv
|
||||
local neq = t.neq
|
||||
local set_session = t.set_session
|
||||
local spawn = t.spawn
|
||||
local tmpname = t.tmpname
|
||||
local write_file = t.write_file
|
||||
|
||||
describe('Remote', function()
|
||||
local fname, other_fname
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local clear = helpers.clear
|
||||
local api = helpers.api
|
||||
local exc_exec = helpers.exc_exec
|
||||
local fn = helpers.fn
|
||||
local rmdir = helpers.rmdir
|
||||
local write_file = helpers.write_file
|
||||
local mkdir = helpers.mkdir
|
||||
local eq = t.eq
|
||||
local clear = t.clear
|
||||
local api = t.api
|
||||
local exc_exec = t.exc_exec
|
||||
local fn = t.fn
|
||||
local rmdir = t.rmdir
|
||||
local write_file = t.write_file
|
||||
local mkdir = t.mkdir
|
||||
|
||||
local testdir = 'Xtest-functional-spell-spellfile.d'
|
||||
|
||||
|
@ -1,38 +1,38 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local assert_alive = helpers.assert_alive
|
||||
local assert_log = helpers.assert_log
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local ok = helpers.ok
|
||||
local eq = helpers.eq
|
||||
local matches = helpers.matches
|
||||
local eval = helpers.eval
|
||||
local exec = helpers.exec
|
||||
local exec_capture = helpers.exec_capture
|
||||
local exec_lua = helpers.exec_lua
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local assert_alive = t.assert_alive
|
||||
local assert_log = t.assert_log
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local ok = t.ok
|
||||
local eq = t.eq
|
||||
local matches = t.matches
|
||||
local eval = t.eval
|
||||
local exec = t.exec
|
||||
local exec_capture = t.exec_capture
|
||||
local exec_lua = t.exec_lua
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
local pesc = vim.pesc
|
||||
local mkdir = helpers.mkdir
|
||||
local mkdir_p = helpers.mkdir_p
|
||||
local nvim_prog = helpers.nvim_prog
|
||||
local nvim_set = helpers.nvim_set
|
||||
local read_file = helpers.read_file
|
||||
local retry = helpers.retry
|
||||
local rmdir = helpers.rmdir
|
||||
local mkdir = t.mkdir
|
||||
local mkdir_p = t.mkdir_p
|
||||
local nvim_prog = t.nvim_prog
|
||||
local nvim_set = t.nvim_set
|
||||
local read_file = t.read_file
|
||||
local retry = t.retry
|
||||
local rmdir = t.rmdir
|
||||
local sleep = vim.uv.sleep
|
||||
local startswith = vim.startswith
|
||||
local write_file = helpers.write_file
|
||||
local api = helpers.api
|
||||
local alter_slashes = helpers.alter_slashes
|
||||
local is_os = helpers.is_os
|
||||
local dedent = helpers.dedent
|
||||
local write_file = t.write_file
|
||||
local api = t.api
|
||||
local alter_slashes = t.alter_slashes
|
||||
local is_os = t.is_os
|
||||
local dedent = t.dedent
|
||||
local tbl_map = vim.tbl_map
|
||||
local tbl_filter = vim.tbl_filter
|
||||
local endswith = vim.endswith
|
||||
local check_close = helpers.check_close
|
||||
local check_close = t.check_close
|
||||
|
||||
local testlog = 'Xtest-startupspec-log'
|
||||
|
||||
@ -467,7 +467,7 @@ describe('startup', function()
|
||||
|
|
||||
]])
|
||||
if not is_os('win') then
|
||||
assert_log('Failed to get flags on descriptor 3: Bad file descriptor', testlog)
|
||||
assert_log('Failed to get flags on descriptor 3: Bad file descriptor', testlog, 100)
|
||||
end
|
||||
end)
|
||||
|
||||
@ -994,7 +994,7 @@ describe('sysinit', function()
|
||||
local xdgdir = 'Xxdg'
|
||||
local vimdir = 'Xvim'
|
||||
local xhome = 'Xhome'
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
|
||||
before_each(function()
|
||||
rmdir(xdgdir)
|
||||
@ -1055,7 +1055,7 @@ end)
|
||||
|
||||
describe('user config init', function()
|
||||
local xhome = 'Xhome'
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
local xconfig = xhome .. pathsep .. 'Xconfig'
|
||||
local xdata = xhome .. pathsep .. 'Xdata'
|
||||
local init_lua_path = table.concat({ xconfig, 'nvim', 'init.lua' }, pathsep)
|
||||
@ -1218,7 +1218,7 @@ end)
|
||||
|
||||
describe('runtime:', function()
|
||||
local xhome = 'Xhome'
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
local xconfig = xhome .. pathsep .. 'Xconfig'
|
||||
local xdata = xhome .. pathsep .. 'Xdata'
|
||||
local xenv = { XDG_CONFIG_HOME = xconfig, XDG_DATA_HOME = xdata }
|
||||
@ -1360,7 +1360,7 @@ end)
|
||||
|
||||
describe('user session', function()
|
||||
local xhome = 'Xhome'
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local pathsep = t.get_pathsep()
|
||||
local session_file = table.concat({ xhome, 'session.lua' }, pathsep)
|
||||
|
||||
before_each(function()
|
||||
|
@ -1,6 +1,5 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local eq, clear, eval, feed, api, retry =
|
||||
helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.api, helpers.retry
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local eq, clear, eval, feed, api, retry = t.eq, t.clear, t.eval, t.feed, t.api, t.retry
|
||||
|
||||
describe('K', function()
|
||||
local test_file = 'K_spec_out'
|
||||
@ -13,19 +12,19 @@ describe('K', function()
|
||||
end)
|
||||
|
||||
it("invokes colon-prefixed 'keywordprg' as Vim command", function()
|
||||
helpers.source([[
|
||||
t.source([[
|
||||
let @a='fnord'
|
||||
set keywordprg=:put]])
|
||||
|
||||
-- K on the text "a" resolves to `:put a`.
|
||||
feed('ia<ESC>K')
|
||||
helpers.expect([[
|
||||
t.expect([[
|
||||
a
|
||||
fnord]])
|
||||
end)
|
||||
|
||||
it("invokes non-prefixed 'keywordprg' as shell command", function()
|
||||
helpers.source([[
|
||||
t.source([[
|
||||
let @a='fnord'
|
||||
set keywordprg=echo\ fnord>>]])
|
||||
|
||||
@ -43,7 +42,7 @@ describe('K', function()
|
||||
end)
|
||||
|
||||
it("<esc> kills the buffer for a running 'keywordprg' command", function()
|
||||
helpers.source('set keywordprg=less')
|
||||
t.source('set keywordprg=less')
|
||||
eval('writefile(["hello", "world"], "' .. test_file .. '")')
|
||||
feed('i' .. test_file .. '<esc>K')
|
||||
eq('t', eval('mode()'))
|
||||
@ -57,7 +56,7 @@ describe('K', function()
|
||||
local bufnr = eval('bufnr()')
|
||||
feed('<esc>')
|
||||
eq('n', eval('mode()'))
|
||||
helpers.neq(bufnr, eval('bufnr()'))
|
||||
t.neq(bufnr, eval('bufnr()'))
|
||||
end)
|
||||
|
||||
it('empty string falls back to :help #19298', function()
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local assert_alive = helpers.assert_alive
|
||||
local clear, feed = helpers.clear, helpers.feed
|
||||
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
|
||||
local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect
|
||||
local fn = helpers.fn
|
||||
local command = helpers.command
|
||||
local api = helpers.api
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local assert_alive = t.assert_alive
|
||||
local clear, feed = t.clear, t.feed
|
||||
local eval, eq, neq = t.eval, t.eq, t.neq
|
||||
local feed_command, source, expect = t.feed_command, t.source, t.expect
|
||||
local fn = t.fn
|
||||
local command = t.command
|
||||
local api = t.api
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
|
||||
describe('completion', function()
|
||||
local screen
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
|
||||
describe('v:count/v:count1', function()
|
||||
before_each(function()
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, feed, source = helpers.clear, helpers.feed, helpers.source
|
||||
local command = helpers.command
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local clear, feed, source = t.clear, t.feed, t.source
|
||||
local command = t.command
|
||||
local poke_eventloop = t.poke_eventloop
|
||||
local sleep = vim.uv.sleep
|
||||
|
||||
describe('CTRL-C (mapped)', function()
|
||||
@ -16,7 +16,7 @@ describe('CTRL-C (mapped)', function()
|
||||
|
||||
it('interrupts :global', function()
|
||||
-- Crashes luajit.
|
||||
if helpers.skip_fragile(pending) then
|
||||
if t.skip_fragile(pending) then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local insert = helpers.insert
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local expect = helpers.expect
|
||||
local command = helpers.command
|
||||
local fn = helpers.fn
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local clear = t.clear
|
||||
local insert = t.insert
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local expect = t.expect
|
||||
local command = t.command
|
||||
local fn = t.fn
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
|
||||
describe('Folding', function()
|
||||
local tempfname = 'Xtest-fold.txt'
|
||||
@ -301,7 +301,7 @@ a]],
|
||||
|
||||
it('updates correctly on :read', function()
|
||||
-- luacheck: ignore 621
|
||||
helpers.write_file(
|
||||
t.write_file(
|
||||
tempfname,
|
||||
[[
|
||||
a
|
||||
@ -376,7 +376,7 @@ a]],
|
||||
end)
|
||||
|
||||
it('splits folds according to >N and <N with foldexpr', function()
|
||||
helpers.source([[
|
||||
t.source([[
|
||||
function TestFoldExpr(lnum)
|
||||
let thisline = getline(a:lnum)
|
||||
if thisline == 'a'
|
||||
@ -391,7 +391,7 @@ a]],
|
||||
return 0
|
||||
endfunction
|
||||
]])
|
||||
helpers.write_file(
|
||||
t.write_file(
|
||||
tempfname,
|
||||
[[
|
||||
b
|
||||
|
@ -1,15 +1,15 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local dedent = helpers.dedent
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local feed = helpers.feed
|
||||
local exec_capture = helpers.exec_capture
|
||||
local write_file = helpers.write_file
|
||||
local api = helpers.api
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local dedent = t.dedent
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local feed = t.feed
|
||||
local exec_capture = t.exec_capture
|
||||
local write_file = t.write_file
|
||||
local api = t.api
|
||||
|
||||
describe('jumplist', function()
|
||||
local fname1 = 'Xtest-functional-normal-jump'
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, insert, eq = helpers.clear, helpers.insert, helpers.eq
|
||||
local command, expect = helpers.command, helpers.expect
|
||||
local feed, eval = helpers.feed, helpers.eval
|
||||
local exc_exec = helpers.exc_exec
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, insert, eq = t.clear, t.insert, t.eq
|
||||
local command, expect = t.command, t.expect
|
||||
local feed, eval = t.feed, t.eval
|
||||
local exc_exec = t.exc_exec
|
||||
|
||||
describe('gu and gU', function()
|
||||
before_each(clear)
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq, neq, call = helpers.eq, helpers.neq, helpers.call
|
||||
local eval, feed, clear = helpers.eval, helpers.feed, helpers.clear
|
||||
local command, insert, expect = helpers.command, helpers.insert, helpers.expect
|
||||
local feed_command = helpers.feed_command
|
||||
local curwin = helpers.api.nvim_get_current_win
|
||||
local eq, neq, call = t.eq, t.neq, t.call
|
||||
local eval, feed, clear = t.eval, t.feed, t.clear
|
||||
local command, insert, expect = t.command, t.insert, t.expect
|
||||
local feed_command = t.feed_command
|
||||
local curwin = t.api.nvim_get_current_win
|
||||
|
||||
describe("'langmap'", function()
|
||||
before_each(function()
|
||||
@ -133,7 +133,7 @@ describe("'langmap'", function()
|
||||
hello]])
|
||||
end)
|
||||
it('command-line CTRL-R', function()
|
||||
helpers.source([[
|
||||
t.source([[
|
||||
let i_value = 0
|
||||
let j_value = 0
|
||||
call setreg('i', 'i_value')
|
||||
@ -171,7 +171,7 @@ describe("'langmap'", function()
|
||||
end)
|
||||
it('prompt for number', function()
|
||||
command('set langmap=12,21')
|
||||
helpers.source([[
|
||||
t.source([[
|
||||
let gotten_one = 0
|
||||
function Map()
|
||||
let answer = inputlist(['a', '1.', '2.', '3.'])
|
||||
@ -214,10 +214,7 @@ describe("'langmap'", function()
|
||||
end
|
||||
feed('qa' .. command_string .. 'q')
|
||||
expect(expect_string)
|
||||
eq(
|
||||
expect_macro or helpers.fn.nvim_replace_termcodes(command_string, true, true, true),
|
||||
eval('@a')
|
||||
)
|
||||
eq(expect_macro or t.fn.nvim_replace_termcodes(command_string, true, true, true), eval('@a'))
|
||||
if setup_function then
|
||||
setup_function()
|
||||
end
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local expect = helpers.expect
|
||||
local command = helpers.command
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local insert = helpers.insert
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
local expect = t.expect
|
||||
local command = t.command
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local insert = t.insert
|
||||
|
||||
describe('macros', function()
|
||||
before_each(function()
|
||||
|
@ -1,15 +1,15 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local api = helpers.api
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local fn = helpers.fn
|
||||
local eq = helpers.eq
|
||||
local feed = helpers.feed
|
||||
local write_file = helpers.write_file
|
||||
local pcall_err = helpers.pcall_err
|
||||
local api = t.api
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local fn = t.fn
|
||||
local eq = t.eq
|
||||
local feed = t.feed
|
||||
local write_file = t.write_file
|
||||
local pcall_err = t.pcall_err
|
||||
local cursor = function()
|
||||
return helpers.api.nvim_win_get_cursor(0)
|
||||
return t.api.nvim_win_get_cursor(0)
|
||||
end
|
||||
|
||||
describe('named marks', function()
|
||||
@ -39,59 +39,59 @@ describe('named marks', function()
|
||||
|
||||
it('errors when set out of range with :mark', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, '1000mark x')
|
||||
local err = pcall_err(t.exec_capture, '1000mark x')
|
||||
eq('nvim_exec2(): Vim(mark):E16: Invalid range: 1000mark x', err)
|
||||
end)
|
||||
|
||||
it('errors when set out of range with :k', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, '1000kx')
|
||||
local err = pcall_err(t.exec_capture, '1000kx')
|
||||
eq('nvim_exec2(): Vim(k):E16: Invalid range: 1000kx', err)
|
||||
end)
|
||||
|
||||
it('errors on unknown mark name with :mark', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, 'mark #')
|
||||
local err = pcall_err(t.exec_capture, 'mark #')
|
||||
eq('nvim_exec2(): Vim(mark):E191: Argument must be a letter or forward/backward quote', err)
|
||||
end)
|
||||
|
||||
it("errors on unknown mark name with '", function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, "normal! '#")
|
||||
local err = pcall_err(t.exec_capture, "normal! '#")
|
||||
eq('nvim_exec2(): Vim(normal):E78: Unknown mark', err)
|
||||
end)
|
||||
|
||||
it('errors on unknown mark name with `', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, 'normal! `#')
|
||||
local err = pcall_err(t.exec_capture, 'normal! `#')
|
||||
eq('nvim_exec2(): Vim(normal):E78: Unknown mark', err)
|
||||
end)
|
||||
|
||||
it("errors when moving to a mark that is not set with '", function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, "normal! 'z")
|
||||
local err = pcall_err(t.exec_capture, "normal! 'z")
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
err = pcall_err(helpers.exec_capture, "normal! '.")
|
||||
err = pcall_err(t.exec_capture, "normal! '.")
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
end)
|
||||
|
||||
it('errors when moving to a mark that is not set with `', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, 'normal! `z')
|
||||
local err = pcall_err(t.exec_capture, 'normal! `z')
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
err = pcall_err(helpers.exec_capture, 'normal! `>')
|
||||
err = pcall_err(t.exec_capture, 'normal! `>')
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
end)
|
||||
|
||||
it("errors when moving to a global mark that is not set with '", function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, "normal! 'Z")
|
||||
local err = pcall_err(t.exec_capture, "normal! 'Z")
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
end)
|
||||
|
||||
it('errors when moving to a global mark that is not set with `', function()
|
||||
command('edit ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, 'normal! `Z')
|
||||
local err = pcall_err(t.exec_capture, 'normal! `Z')
|
||||
eq('nvim_exec2(): Vim(normal):E20: Mark not set', err)
|
||||
end)
|
||||
|
||||
@ -166,7 +166,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
command('bw! ' .. file1)
|
||||
local err = pcall_err(helpers.exec_capture, "normal! 'A")
|
||||
local err = pcall_err(t.exec_capture, "normal! 'A")
|
||||
eq('nvim_exec2(): Vim(normal):E92: Buffer 1 not found', err)
|
||||
os.remove(file1)
|
||||
end)
|
||||
|
@ -1,11 +1,11 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||
local command = helpers.command
|
||||
local exec_lua = helpers.exec_lua
|
||||
local eval = helpers.eval
|
||||
local expect = helpers.expect
|
||||
local fn = helpers.fn
|
||||
local eq = helpers.eq
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, feed, insert = t.clear, t.feed, t.insert
|
||||
local command = t.command
|
||||
local exec_lua = t.exec_lua
|
||||
local eval = t.eval
|
||||
local expect = t.expect
|
||||
local fn = t.fn
|
||||
local eq = t.eq
|
||||
|
||||
describe('meta-keys #8226 #13042', function()
|
||||
before_each(function()
|
||||
|
@ -1,12 +1,11 @@
|
||||
-- Cmdline-mode tests.
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, insert, fn, eq, feed =
|
||||
helpers.clear, helpers.insert, helpers.fn, helpers.eq, helpers.feed
|
||||
local eval = helpers.eval
|
||||
local command = helpers.command
|
||||
local api = helpers.api
|
||||
local clear, insert, fn, eq, feed = t.clear, t.insert, t.fn, t.eq, t.feed
|
||||
local eval = t.eval
|
||||
local command = t.command
|
||||
local api = t.api
|
||||
|
||||
describe('cmdline', function()
|
||||
before_each(clear)
|
||||
|
@ -1,14 +1,14 @@
|
||||
-- Insert-mode tests.
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
|
||||
local expect = helpers.expect
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local curbuf_contents = helpers.curbuf_contents
|
||||
local api = helpers.api
|
||||
local clear, feed, insert = t.clear, t.feed, t.insert
|
||||
local expect = t.expect
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local curbuf_contents = t.curbuf_contents
|
||||
local api = t.api
|
||||
|
||||
describe('insert-mode', function()
|
||||
before_each(function()
|
||||
@ -232,10 +232,10 @@ describe('insert-mode', function()
|
||||
end
|
||||
|
||||
local function test_cols(expected_cols)
|
||||
local cols = { { helpers.fn.col('.'), helpers.fn.virtcol('.') } }
|
||||
local cols = { { t.fn.col('.'), t.fn.virtcol('.') } }
|
||||
for _ = 2, #expected_cols do
|
||||
feed('<BS>')
|
||||
table.insert(cols, { helpers.fn.col('.'), helpers.fn.virtcol('.') })
|
||||
table.insert(cols, { t.fn.col('.'), t.fn.virtcol('.') })
|
||||
end
|
||||
eq(expected_cols, cols)
|
||||
end
|
||||
|
@ -1,11 +1,11 @@
|
||||
-- Normal mode tests.
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local feed = helpers.feed
|
||||
local fn = helpers.fn
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local feed = t.feed
|
||||
local fn = t.fn
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
|
||||
describe('Normal mode', function()
|
||||
before_each(clear)
|
||||
|
@ -1,18 +1,18 @@
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local insert = helpers.insert
|
||||
local feed = helpers.feed
|
||||
local expect = helpers.expect
|
||||
local eq = helpers.eq
|
||||
local clear = t.clear
|
||||
local insert = t.insert
|
||||
local feed = t.feed
|
||||
local expect = t.expect
|
||||
local eq = t.eq
|
||||
local map = vim.tbl_map
|
||||
local filter = vim.tbl_filter
|
||||
local feed_command = helpers.feed_command
|
||||
local command = helpers.command
|
||||
local curbuf_contents = helpers.curbuf_contents
|
||||
local fn = helpers.fn
|
||||
local dedent = helpers.dedent
|
||||
local feed_command = t.feed_command
|
||||
local command = t.command
|
||||
local curbuf_contents = t.curbuf_contents
|
||||
local fn = t.fn
|
||||
local dedent = t.dedent
|
||||
|
||||
local function reset()
|
||||
command('bwipe! | new')
|
||||
@ -75,7 +75,7 @@ describe('put command', function()
|
||||
extra_setup()
|
||||
end
|
||||
local orig_dotstr = fn.getreg('.')
|
||||
helpers.ok(visual_marks_zero())
|
||||
t.ok(visual_marks_zero())
|
||||
-- Make sure every test starts from the same conditions
|
||||
assert_no_change(test.exception_table, false)
|
||||
local was_cli = test.test_action()
|
||||
@ -890,7 +890,7 @@ describe('put command', function()
|
||||
-- check bell is not set by nvim before the action
|
||||
screen:sleep(50)
|
||||
end
|
||||
helpers.ok(not screen.bell and not screen.visualbell)
|
||||
t.ok(not screen.bell and not screen.visualbell)
|
||||
actions()
|
||||
screen:expect {
|
||||
condition = function()
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local pcall_err = helpers.pcall_err
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local pcall_err = t.pcall_err
|
||||
|
||||
describe('search (/)', function()
|
||||
before_each(clear)
|
||||
|
@ -1,17 +1,17 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local feed = helpers.feed
|
||||
local eval = helpers.eval
|
||||
local exec = helpers.exec
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local curwin = helpers.api.nvim_get_current_win
|
||||
local assert_alive = helpers.assert_alive
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local feed = t.feed
|
||||
local eval = t.eval
|
||||
local exec = t.exec
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local curwin = t.api.nvim_get_current_win
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('tabpage', function()
|
||||
before_each(clear)
|
||||
|
@ -1,16 +1,16 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eval = helpers.eval
|
||||
local expect = helpers.expect
|
||||
local eq = helpers.eq
|
||||
local feed = helpers.feed
|
||||
local feed_command = helpers.feed_command
|
||||
local insert = helpers.insert
|
||||
local fn = helpers.fn
|
||||
local exec = helpers.exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eval = t.eval
|
||||
local expect = t.expect
|
||||
local eq = t.eq
|
||||
local feed = t.feed
|
||||
local feed_command = t.feed_command
|
||||
local insert = t.insert
|
||||
local fn = t.fn
|
||||
local exec = t.exec
|
||||
local exec_lua = t.exec_lua
|
||||
|
||||
local function lastmessage()
|
||||
local messages = fn.split(fn.execute('messages'), '\n')
|
||||
@ -44,7 +44,7 @@ describe('u CTRL-R g- g+', function()
|
||||
local function undo_and_redo(hist_pos, undo, redo, expect_str)
|
||||
command('enew!')
|
||||
create_history(hist_pos)
|
||||
local cur_contents = helpers.curbuf_contents()
|
||||
local cur_contents = t.curbuf_contents()
|
||||
feed(undo)
|
||||
expect(expect_str)
|
||||
feed(redo)
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local dedent = helpers.dedent
|
||||
local exec = helpers.exec
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local fn = helpers.fn
|
||||
local command = helpers.command
|
||||
local api = helpers.api
|
||||
local eq = t.eq
|
||||
local dedent = t.dedent
|
||||
local exec = t.exec
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
local fn = t.fn
|
||||
local command = t.command
|
||||
local api = t.api
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local cmdtest = function(cmd, prep, ret1)
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local eq, command, fn = helpers.eq, helpers.command, helpers.fn
|
||||
local ok = helpers.ok
|
||||
local matches = helpers.matches
|
||||
local clear = helpers.clear
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local eq, command, fn = t.eq, t.command, t.fn
|
||||
local ok = t.ok
|
||||
local matches = t.matches
|
||||
local clear = t.clear
|
||||
|
||||
describe(':argument', function()
|
||||
before_each(function()
|
||||
@ -11,19 +11,19 @@ describe(':argument', function()
|
||||
|
||||
it('does not restart :terminal buffer', function()
|
||||
command('terminal')
|
||||
helpers.feed([[<C-\><C-N>]])
|
||||
t.feed([[<C-\><C-N>]])
|
||||
command('argadd')
|
||||
helpers.feed([[<C-\><C-N>]])
|
||||
t.feed([[<C-\><C-N>]])
|
||||
local bufname_before = fn.bufname('%')
|
||||
local bufnr_before = fn.bufnr('%')
|
||||
matches('^term://', bufname_before) -- sanity
|
||||
|
||||
command('argument 1')
|
||||
helpers.feed([[<C-\><C-N>]])
|
||||
t.feed([[<C-\><C-N>]])
|
||||
|
||||
local bufname_after = fn.bufname('%')
|
||||
local bufnr_after = fn.bufnr('%')
|
||||
eq('[' .. bufname_before .. ']', helpers.eval('trim(execute("args"))'))
|
||||
eq('[' .. bufname_before .. ']', t.eval('trim(execute("args"))'))
|
||||
ok(fn.line('$') > 1)
|
||||
eq(bufname_before, bufname_after)
|
||||
eq(bufnr_before, bufnr_after)
|
||||
|
@ -1,16 +1,16 @@
|
||||
-- Specs for :cd, :tcd, :lcd and getcwd()
|
||||
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local call = helpers.call
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local exc_exec = helpers.exc_exec
|
||||
local pathsep = helpers.get_pathsep()
|
||||
local skip = helpers.skip
|
||||
local is_os = helpers.is_os
|
||||
local mkdir = helpers.mkdir
|
||||
local eq = t.eq
|
||||
local call = t.call
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local exc_exec = t.exc_exec
|
||||
local pathsep = t.get_pathsep()
|
||||
local skip = t.skip
|
||||
local is_os = t.is_os
|
||||
local mkdir = t.mkdir
|
||||
|
||||
-- These directories will be created for testing
|
||||
local directories = {
|
||||
@ -289,14 +289,14 @@ describe('getcwd()', function()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
helpers.rmdir(directories.global)
|
||||
t.rmdir(directories.global)
|
||||
end)
|
||||
|
||||
it('returns empty string if working directory does not exist', function()
|
||||
skip(is_os('win'))
|
||||
command('cd ' .. directories.global)
|
||||
command("call delete('../" .. directories.global .. "', 'd')")
|
||||
eq('', helpers.eval('getcwd()'))
|
||||
eq('', t.eval('getcwd()'))
|
||||
end)
|
||||
|
||||
it("works with 'autochdir' after local directory was set (#9892)", function()
|
||||
|
@ -1,14 +1,14 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local feed = helpers.feed
|
||||
local eq = helpers.eq
|
||||
local expect = helpers.expect
|
||||
local eval = helpers.eval
|
||||
local fn = helpers.fn
|
||||
local insert = helpers.insert
|
||||
local write_file = helpers.write_file
|
||||
local exc_exec = helpers.exc_exec
|
||||
local command = helpers.command
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local feed = t.feed
|
||||
local eq = t.eq
|
||||
local expect = t.expect
|
||||
local eval = t.eval
|
||||
local fn = t.fn
|
||||
local insert = t.insert
|
||||
local write_file = t.write_file
|
||||
local exc_exec = t.exc_exec
|
||||
local command = t.command
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
describe('mappings with <Cmd>', function()
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local feed = helpers.feed
|
||||
local clear = helpers.clear
|
||||
local feed = t.feed
|
||||
local clear = t.clear
|
||||
|
||||
describe(':debug', function()
|
||||
local screen
|
||||
|
@ -1,13 +1,13 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local assert_alive = helpers.assert_alive
|
||||
local clear, source = helpers.clear, helpers.source
|
||||
local api = helpers.api
|
||||
local insert = helpers.insert
|
||||
local eq, next_msg = helpers.eq, helpers.next_msg
|
||||
local exc_exec = helpers.exc_exec
|
||||
local exec_lua = helpers.exec_lua
|
||||
local command = helpers.command
|
||||
local eval = helpers.eval
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local assert_alive = t.assert_alive
|
||||
local clear, source = t.clear, t.source
|
||||
local api = t.api
|
||||
local insert = t.insert
|
||||
local eq, next_msg = t.eq, t.next_msg
|
||||
local exc_exec = t.exc_exec
|
||||
local exec_lua = t.exec_lua
|
||||
local command = t.command
|
||||
local eval = t.eval
|
||||
|
||||
describe('Vimscript dictionary notifications', function()
|
||||
local channel
|
||||
|
@ -1,7 +1,7 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local feed = helpers.feed
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local feed = t.feed
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
describe(':digraphs', function()
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local command = helpers.command
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local command = t.command
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, feed, feed_command = helpers.clear, helpers.feed, helpers.feed_command
|
||||
local exec = helpers.exec
|
||||
local clear, feed, feed_command = t.clear, t.feed, t.feed_command
|
||||
local exec = t.exec
|
||||
|
||||
describe(':drop', function()
|
||||
local screen
|
||||
|
@ -1,17 +1,17 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local eq = helpers.eq
|
||||
local eq = t.eq
|
||||
local NIL = vim.NIL
|
||||
local eval = helpers.eval
|
||||
local clear = helpers.clear
|
||||
local api = helpers.api
|
||||
local fn = helpers.fn
|
||||
local source = helpers.source
|
||||
local dedent = helpers.dedent
|
||||
local command = helpers.command
|
||||
local exc_exec = helpers.exc_exec
|
||||
local exec_capture = helpers.exec_capture
|
||||
local matches = helpers.matches
|
||||
local eval = t.eval
|
||||
local clear = t.clear
|
||||
local api = t.api
|
||||
local fn = t.fn
|
||||
local source = t.source
|
||||
local dedent = t.dedent
|
||||
local command = t.command
|
||||
local exc_exec = t.exc_exec
|
||||
local exec_capture = t.exec_capture
|
||||
local matches = t.matches
|
||||
|
||||
describe(':echo :echon :echomsg :echoerr', function()
|
||||
local fn_tbl = { 'String', 'StringN', 'StringMsg', 'StringErr' }
|
||||
@ -255,7 +255,7 @@ describe(':echo :echon :echomsg :echoerr', function()
|
||||
eval('add(l, l)')
|
||||
-- Regression: the below line used to crash (add returns original list and
|
||||
-- there was error in dumping partials). Tested explicitly in
|
||||
-- test/unit/api/private_helpers_spec.lua.
|
||||
-- test/unit/api/private_t_spec.lua.
|
||||
eval('add(l, function("Test1", l))')
|
||||
eq(
|
||||
dedent(
|
||||
|
@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local eq, command, fn = helpers.eq, helpers.command, helpers.fn
|
||||
local ok = helpers.ok
|
||||
local matches = helpers.matches
|
||||
local clear = helpers.clear
|
||||
local feed = helpers.feed
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local eq, command, fn = t.eq, t.command, t.fn
|
||||
local ok = t.ok
|
||||
local matches = t.matches
|
||||
local clear = t.clear
|
||||
local feed = t.feed
|
||||
|
||||
describe(':edit', function()
|
||||
before_each(function()
|
||||
|
@ -1,6 +1,6 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, feed_command, feed = helpers.clear, helpers.feed_command, helpers.feed
|
||||
local eq, neq, eval = helpers.eq, helpers.neq, helpers.eval
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, feed_command, feed = t.clear, t.feed_command, t.feed
|
||||
local eq, neq, eval = t.eq, t.neq, t.eval
|
||||
|
||||
describe('&encoding', function()
|
||||
before_each(function()
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local clear = helpers.clear
|
||||
local fn = helpers.fn
|
||||
local pcall_err = helpers.pcall_err
|
||||
local assert_alive = helpers.assert_alive
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local clear = t.clear
|
||||
local fn = t.fn
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = t.assert_alive
|
||||
|
||||
describe('Ex cmds', function()
|
||||
before_each(function()
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local rmdir = helpers.rmdir
|
||||
local mkdir = helpers.mkdir
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local rmdir = t.rmdir
|
||||
local mkdir = t.mkdir
|
||||
|
||||
describe(':file', function()
|
||||
local swapdir = vim.uv.cwd() .. '/Xtest-file_spec'
|
||||
|
@ -1,6 +1,5 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, feed_command, feed, ok, eval =
|
||||
helpers.clear, helpers.feed_command, helpers.feed, helpers.ok, helpers.eval
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, feed_command, feed, ok, eval = t.clear, t.feed_command, t.feed, t.ok, t.eval
|
||||
|
||||
describe(':grep', function()
|
||||
before_each(clear)
|
||||
|
@ -1,19 +1,19 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local mkdir = helpers.mkdir
|
||||
local rmdir = helpers.rmdir
|
||||
local write_file = helpers.write_file
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
local mkdir = t.mkdir
|
||||
local rmdir = t.rmdir
|
||||
local write_file = t.write_file
|
||||
|
||||
describe(':help', function()
|
||||
before_each(clear)
|
||||
|
||||
it('window closed makes cursor return to a valid win/buf #9773', function()
|
||||
helpers.add_builddir_to_rtp()
|
||||
t.add_builddir_to_rtp()
|
||||
command('help help')
|
||||
eq(1001, fn.win_getid())
|
||||
command('quit')
|
||||
|
@ -1,11 +1,11 @@
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local eq, command = helpers.eq, helpers.command
|
||||
local clear = helpers.clear
|
||||
local eval, exc_exec = helpers.eval, helpers.exc_exec
|
||||
local exec = helpers.exec
|
||||
local fn = helpers.fn
|
||||
local api = helpers.api
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local eq, command = t.eq, t.command
|
||||
local clear = t.clear
|
||||
local eval, exc_exec = t.eval, t.exc_exec
|
||||
local exec = t.exec
|
||||
local fn = t.fn
|
||||
local api = t.api
|
||||
|
||||
describe(':highlight', function()
|
||||
local screen
|
||||
|
@ -1,12 +1,12 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local testprg = helpers.testprg
|
||||
local retry = helpers.retry
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local eq = t.eq
|
||||
local eval = t.eval
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local testprg = t.testprg
|
||||
local retry = t.retry
|
||||
|
||||
describe(':ls', function()
|
||||
before_each(function()
|
||||
|
@ -1,10 +1,10 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear = helpers.clear
|
||||
local eval = helpers.eval
|
||||
local has_powershell = helpers.has_powershell
|
||||
local matches = helpers.matches
|
||||
local api = helpers.api
|
||||
local testprg = helpers.testprg
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear = t.clear
|
||||
local eval = t.eval
|
||||
local has_powershell = t.has_powershell
|
||||
local matches = t.matches
|
||||
local api = t.api
|
||||
local testprg = t.testprg
|
||||
|
||||
describe(':make', function()
|
||||
clear()
|
||||
@ -18,7 +18,7 @@ describe(':make', function()
|
||||
return
|
||||
end
|
||||
before_each(function()
|
||||
helpers.set_shell_powershell()
|
||||
t.set_shell_powershell()
|
||||
end)
|
||||
|
||||
it('captures stderr & non zero exit code #14349', function()
|
||||
|
@ -1,16 +1,16 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local eq = helpers.eq
|
||||
local exec = helpers.exec
|
||||
local exec_capture = helpers.exec_capture
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local expect = helpers.expect
|
||||
local insert = helpers.insert
|
||||
local eval = helpers.eval
|
||||
local eq = t.eq
|
||||
local exec = t.exec
|
||||
local exec_capture = t.exec_capture
|
||||
local feed = t.feed
|
||||
local api = t.api
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local expect = t.expect
|
||||
local insert = t.insert
|
||||
local eval = t.eval
|
||||
|
||||
describe(':*map', function()
|
||||
before_each(clear)
|
||||
|
@ -1,8 +1,8 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, command = helpers.clear, helpers.command
|
||||
local expect, feed = helpers.expect, helpers.feed
|
||||
local eq, eval = helpers.eq, helpers.eval
|
||||
local fn = helpers.fn
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local clear, command = t.clear, t.command
|
||||
local expect, feed = t.expect, t.feed
|
||||
local eq, eval = t.eq, t.eval
|
||||
local fn = t.fn
|
||||
|
||||
describe(':emenu', function()
|
||||
before_each(function()
|
||||
|
@ -1,20 +1,20 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local get_pathsep = helpers.get_pathsep
|
||||
local eq = helpers.eq
|
||||
local neq = helpers.neq
|
||||
local fn = helpers.fn
|
||||
local matches = helpers.matches
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local get_pathsep = t.get_pathsep
|
||||
local eq = t.eq
|
||||
local neq = t.neq
|
||||
local fn = t.fn
|
||||
local matches = t.matches
|
||||
local pesc = vim.pesc
|
||||
local rmdir = helpers.rmdir
|
||||
local rmdir = t.rmdir
|
||||
local sleep = vim.uv.sleep
|
||||
local api = helpers.api
|
||||
local skip = helpers.skip
|
||||
local is_os = helpers.is_os
|
||||
local mkdir = helpers.mkdir
|
||||
local api = t.api
|
||||
local skip = t.skip
|
||||
local is_os = t.is_os
|
||||
local mkdir = t.mkdir
|
||||
|
||||
local file_prefix = 'Xtest-functional-ex_cmds-mksession_spec'
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local t = require('test.functional.testutil')(after_each)
|
||||
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local get_pathsep = helpers.get_pathsep
|
||||
local eq = helpers.eq
|
||||
local fn = helpers.fn
|
||||
local rmdir = helpers.rmdir
|
||||
local mkdir = helpers.mkdir
|
||||
local clear = t.clear
|
||||
local command = t.command
|
||||
local get_pathsep = t.get_pathsep
|
||||
local eq = t.eq
|
||||
local fn = t.fn
|
||||
local rmdir = t.rmdir
|
||||
local mkdir = t.mkdir
|
||||
|
||||
local file_prefix = 'Xtest-functional-ex_cmds-mkview_spec'
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user