diff options
Diffstat (limited to 'test/functional/lua')
34 files changed, 259 insertions, 207 deletions
diff --git a/test/functional/lua/api_spec.lua b/test/functional/lua/api_spec.lua index a9bcb05c16..56969150bd 100644 --- a/test/functional/lua/api_spec.lua +++ b/test/functional/lua/api_spec.lua @@ -1,14 +1,15 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local exc_exec = t.exc_exec +local exc_exec = n.exc_exec local remove_trace = t.remove_trace -local fn = t.fn -local clear = t.clear -local eval = t.eval +local fn = n.fn +local clear = n.clear +local eval = n.eval local NIL = vim.NIL local eq = t.eq -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua local pcall_err = t.pcall_err before_each(clear) diff --git a/test/functional/lua/base64_spec.lua b/test/functional/lua/base64_spec.lua index c7fbe2ad23..529f5f56e8 100644 --- a/test/functional/lua/base64_spec.lua +++ b/test/functional/lua/base64_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local pcall_err = t.pcall_err local matches = t.matches diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua index 0969c8f137..d4af7e4732 100644 --- a/test/functional/lua/buffer_updates_spec.lua +++ b/test/functional/lua/buffer_updates_spec.lua @@ -1,15 +1,16 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') -local command = t.command -local api = t.api -local fn = t.fn -local clear = t.clear +local command = n.command +local api = n.api +local fn = n.fn +local clear = n.clear local eq = t.eq local fail = t.fail -local exec_lua = t.exec_lua -local feed = t.feed +local exec_lua = n.exec_lua +local feed = n.feed local expect_events = t.expect_events local write_file = t.write_file local dedent = t.dedent @@ -292,11 +293,11 @@ describe('lua buffer event callbacks: on_lines', function() exec_lua(code) command('q!') - t.assert_alive() + n.assert_alive() exec_lua(code) command('bd!') - t.assert_alive() + n.assert_alive() end) it('#12718 lnume', function() @@ -965,7 +966,7 @@ describe('lua: nvim_buf_attach on_bytes', function() command('e! Xtest-undofile') command('set undodir=. | set undofile') - local ns = t.request('nvim_create_namespace', 'ns1') + local ns = n.request('nvim_create_namespace', 'ns1') api.nvim_buf_set_extmark(0, ns, 0, 0, {}) eq({ '12345', 'hello world' }, api.nvim_buf_get_lines(0, 0, -1, true)) diff --git a/test/functional/lua/command_line_completion_spec.lua b/test/functional/lua/command_line_completion_spec.lua index 4dc0356283..2ba432133b 100644 --- a/test/functional/lua/command_line_completion_spec.lua +++ b/test/functional/lua/command_line_completion_spec.lua @@ -1,8 +1,9 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local clear = t.clear +local clear = n.clear local eq = t.eq -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua local get_completions = function(input, env) return exec_lua('return {vim._expand_pat(...)}', input, env) diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua index d0418fce26..57b084d3d6 100644 --- a/test/functional/lua/commands_spec.lua +++ b/test/functional/lua/commands_spec.lua @@ -1,21 +1,22 @@ -- Test suite for checking :lua* commands -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local eq = t.eq local NIL = vim.NIL -local eval = t.eval -local feed = t.feed -local clear = t.clear +local eval = n.eval +local feed = n.feed +local clear = n.clear local matches = t.matches -local api = t.api -local exec_lua = t.exec_lua -local exec_capture = t.exec_capture -local fn = t.fn -local source = t.source +local api = n.api +local exec_lua = n.exec_lua +local exec_capture = n.exec_capture +local fn = n.fn +local source = n.source local dedent = t.dedent -local command = t.command -local exc_exec = t.exc_exec +local command = n.command +local exc_exec = n.exc_exec local pcall_err = t.pcall_err local write_file = t.write_file local remove_trace = t.remove_trace diff --git a/test/functional/lua/comment_spec.lua b/test/functional/lua/comment_spec.lua index df7776d928..9b1d9613cb 100644 --- a/test/functional/lua/comment_spec.lua +++ b/test/functional/lua/comment_spec.lua @@ -1,11 +1,12 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local api = t.api -local clear = t.clear +local api = n.api +local clear = n.clear local eq = t.eq -local exec_capture = t.exec_capture -local exec_lua = t.exec_lua -local feed = t.feed +local exec_capture = n.exec_capture +local exec_lua = n.exec_lua +local feed = n.feed -- Reference text -- aa diff --git a/test/functional/lua/diagnostic_spec.lua b/test/functional/lua/diagnostic_spec.lua index be3d55089b..f36a676ba9 100644 --- a/test/functional/lua/diagnostic_spec.lua +++ b/test/functional/lua/diagnostic_spec.lua @@ -1,14 +1,15 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local NIL = vim.NIL -local command = t.command -local clear = t.clear -local exec_lua = t.exec_lua +local command = n.command +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local matches = t.matches -local api = t.api +local api = n.api local pcall_err = t.pcall_err -local fn = t.fn +local fn = n.fn describe('vim.diagnostic', function() before_each(function() @@ -1891,12 +1892,12 @@ describe('vim.diagnostic', function() it('respects legacy signs placed with :sign define or sign_define #26618', function() -- Legacy signs for diagnostics were deprecated in 0.10 and will be removed in 0.12 - eq(0, t.fn.has('nvim-0.12')) + eq(0, n.fn.has('nvim-0.12')) - t.command('sign define DiagnosticSignError text= texthl= linehl=ErrorMsg numhl=ErrorMsg') - t.command('sign define DiagnosticSignWarn text= texthl= linehl=WarningMsg numhl=WarningMsg') - t.command('sign define DiagnosticSignInfo text= texthl= linehl=Underlined numhl=Underlined') - t.command('sign define DiagnosticSignHint text= texthl= linehl=Underlined numhl=Underlined') + n.command('sign define DiagnosticSignError text= texthl= linehl=ErrorMsg numhl=ErrorMsg') + n.command('sign define DiagnosticSignWarn text= texthl= linehl=WarningMsg numhl=WarningMsg') + n.command('sign define DiagnosticSignInfo text= texthl= linehl=Underlined numhl=Underlined') + n.command('sign define DiagnosticSignHint text= texthl= linehl=Underlined numhl=Underlined') local result = exec_lua [[ vim.diagnostic.config({ diff --git a/test/functional/lua/ffi_spec.lua b/test/functional/lua/ffi_spec.lua index 77095fac7a..85ca264107 100644 --- a/test/functional/lua/ffi_spec.lua +++ b/test/functional/lua/ffi_spec.lua @@ -1,7 +1,9 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + local eq = t.eq -local exec_lua = t.exec_lua -local clear = t.clear +local exec_lua = n.exec_lua +local clear = n.clear before_each(clear) diff --git a/test/functional/lua/filetype_spec.lua b/test/functional/lua/filetype_spec.lua index ffd2a7eb60..7db04e6f6b 100644 --- a/test/functional/lua/filetype_spec.lua +++ b/test/functional/lua/filetype_spec.lua @@ -1,12 +1,14 @@ -local t = require('test.functional.testutil')() -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local exec_lua = n.exec_lua local eq = t.eq -local api = t.api -local clear = t.clear -local pathroot = t.pathroot -local command = t.command +local api = n.api +local clear = n.clear +local pathroot = n.pathroot +local command = n.command local mkdir = t.mkdir -local rmdir = t.rmdir +local rmdir = n.rmdir local write_file = t.write_file local uv = vim.uv diff --git a/test/functional/lua/fs_spec.lua b/test/functional/lua/fs_spec.lua index 01d352ef14..db6ff60e9a 100644 --- a/test/functional/lua/fs_spec.lua +++ b/test/functional/lua/fs_spec.lua @@ -1,14 +1,15 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local clear = t.clear -local exec_lua = t.exec_lua +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq -local mkdir_p = t.mkdir_p -local rmdir = t.rmdir -local nvim_dir = t.nvim_dir +local mkdir_p = n.mkdir_p +local rmdir = n.rmdir +local nvim_dir = n.nvim_dir local test_build_dir = t.paths.test_build_dir local test_source_path = t.paths.test_source_path -local nvim_prog = t.nvim_prog +local nvim_prog = n.nvim_prog local is_os = t.is_os local mkdir = t.mkdir diff --git a/test/functional/lua/glob_spec.lua b/test/functional/lua/glob_spec.lua index b1408ce92e..56cd4c9bb5 100644 --- a/test/functional/lua/glob_spec.lua +++ b/test/functional/lua/glob_spec.lua @@ -1,10 +1,12 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + local eq = t.eq -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua describe('glob', function() - before_each(t.clear) - after_each(t.clear) + before_each(n.clear) + after_each(n.clear) local match = function(...) return exec_lua( diff --git a/test/functional/lua/highlight_spec.lua b/test/functional/lua/highlight_spec.lua index dc62fa978c..d47afa6164 100644 --- a/test/functional/lua/highlight_spec.lua +++ b/test/functional/lua/highlight_spec.lua @@ -1,11 +1,13 @@ -local t = require('test.functional.testutil')() -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local exec_lua = n.exec_lua local eq = t.eq local neq = t.neq -local eval = t.eval -local command = t.command -local clear = t.clear -local api = t.api +local eval = n.eval +local command = n.command +local clear = n.clear +local api = n.api describe('vim.highlight.on_yank', function() before_each(function() @@ -19,7 +21,7 @@ describe('vim.highlight.on_yank', function() vim.cmd('bwipeout!') ]]) vim.uv.sleep(10) - t.feed('<cr>') -- avoid hang if error message exists + n.feed('<cr>') -- avoid hang if error message exists eq('', eval('v:errmsg')) end) diff --git a/test/functional/lua/inspector_spec.lua b/test/functional/lua/inspector_spec.lua index 3fd8daff2e..8fadba6ee8 100644 --- a/test/functional/lua/inspector_spec.lua +++ b/test/functional/lua/inspector_spec.lua @@ -1,8 +1,10 @@ -local t = require('test.functional.testutil')() -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local exec_lua = n.exec_lua local eq = t.eq -local eval = t.eval -local clear = t.clear +local eval = n.eval +local clear = n.clear describe('vim.inspect_pos', function() before_each(function() diff --git a/test/functional/lua/iter_spec.lua b/test/functional/lua/iter_spec.lua index 10a0810501..92e809d55c 100644 --- a/test/functional/lua/iter_spec.lua +++ b/test/functional/lua/iter_spec.lua @@ -1,4 +1,5 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') + local eq = t.eq local matches = t.matches local pcall_err = t.pcall_err diff --git a/test/functional/lua/json_spec.lua b/test/functional/lua/json_spec.lua index c1a407110c..78e1896a20 100644 --- a/test/functional/lua/json_spec.lua +++ b/test/functional/lua/json_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local pcall_err = t.pcall_err diff --git a/test/functional/lua/loader_spec.lua b/test/functional/lua/loader_spec.lua index 5cf060ae4b..f13e6664c5 100644 --- a/test/functional/lua/loader_spec.lua +++ b/test/functional/lua/loader_spec.lua @@ -1,9 +1,10 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local exec_lua = t.exec_lua -local command = t.command -local clear = t.clear +local exec_lua = n.exec_lua +local command = n.command +local clear = n.clear local eq = t.eq describe('vim.loader', function() diff --git a/test/functional/lua/loop_spec.lua b/test/functional/lua/loop_spec.lua index f5d9a6c39b..d5c5cd3cd0 100644 --- a/test/functional/lua/loop_spec.lua +++ b/test/functional/lua/loop_spec.lua @@ -1,15 +1,17 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') -local fn = t.fn -local api = t.api -local clear = t.clear + +local fn = n.fn +local api = n.api +local clear = n.clear local sleep = vim.uv.sleep -local feed = t.feed +local feed = n.feed local eq = t.eq -local eval = t.eval +local eval = n.eval local matches = t.matches -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua local retry = t.retry before_each(clear) diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index 51be8798fb..3f62cd8325 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -1,17 +1,18 @@ -- Test suite for testing luaeval() function -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local pcall_err = t.pcall_err -local exc_exec = t.exc_exec +local exc_exec = n.exc_exec local remove_trace = t.remove_trace -local exec_lua = t.exec_lua -local command = t.command -local api = t.api -local fn = t.fn -local clear = t.clear -local eval = t.eval -local feed = t.feed +local exec_lua = n.exec_lua +local command = n.command +local api = n.api +local fn = n.fn +local clear = n.clear +local eval = n.eval +local feed = n.feed local NIL = vim.NIL local eq = t.eq diff --git a/test/functional/lua/mpack_spec.lua b/test/functional/lua/mpack_spec.lua index a9400b34c8..efd69d4607 100644 --- a/test/functional/lua/mpack_spec.lua +++ b/test/functional/lua/mpack_spec.lua @@ -1,9 +1,10 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local clear = t.clear +local clear = n.clear local eq = t.eq -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua describe('lua vim.mpack', function() before_each(clear) diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 7f325da307..849978f080 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -1,17 +1,18 @@ -- Test for Vim overrides of lua built-ins -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local eq = t.eq local NIL = vim.NIL -local feed = t.feed -local clear = t.clear -local fn = t.fn -local api = t.api -local command = t.command +local feed = n.feed +local clear = n.clear +local fn = n.fn +local api = n.api +local command = n.command local write_file = t.write_file -local exec_capture = t.exec_capture -local exec_lua = t.exec_lua +local exec_capture = n.exec_capture +local exec_lua = n.exec_lua local pcall_err = t.pcall_err local is_os = t.is_os diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua index ad685dd8de..4adce42c3e 100644 --- a/test/functional/lua/runtime_spec.lua +++ b/test/functional/lua/runtime_spec.lua @@ -1,17 +1,18 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local clear = t.clear +local clear = n.clear local eq = t.eq -local eval = t.eval -local exec = t.exec -local fn = t.fn -local mkdir_p = t.mkdir_p -local rmdir = t.rmdir +local eval = n.eval +local exec = n.exec +local fn = n.fn +local mkdir_p = n.mkdir_p +local rmdir = n.rmdir local write_file = t.write_file describe('runtime:', function() local plug_dir = 'Test_Plugin' - local sep = t.get_pathsep() + local sep = n.get_pathsep() local init = 'dummy_init.lua' setup(function() diff --git a/test/functional/lua/secure_spec.lua b/test/functional/lua/secure_spec.lua index 1a1a939d7c..c58fd689b7 100644 --- a/test/functional/lua/secure_spec.lua +++ b/test/functional/lua/secure_spec.lua @@ -1,16 +1,17 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local eq = t.eq -local clear = t.clear -local command = t.command -local pathsep = t.get_pathsep() +local clear = n.clear +local command = n.command +local pathsep = n.get_pathsep() local is_os = t.is_os -local api = t.api -local exec_lua = t.exec_lua -local feed_command = t.feed_command -local feed = t.feed -local fn = t.fn +local api = n.api +local exec_lua = n.exec_lua +local feed_command = n.feed_command +local feed = n.feed +local fn = n.fn local stdpath = fn.stdpath local pcall_err = t.pcall_err local matches = t.matches @@ -22,7 +23,7 @@ describe('vim.secure', function() setup(function() clear { env = { XDG_STATE_HOME = xstate } } - t.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim')) + n.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim')) t.write_file( 'Xfile', [[ @@ -33,7 +34,7 @@ describe('vim.secure', function() teardown(function() os.remove('Xfile') - t.rmdir(xstate) + n.rmdir(xstate) end) it('works', function() @@ -181,11 +182,11 @@ describe('vim.secure', function() setup(function() clear { env = { XDG_STATE_HOME = xstate } } - t.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim')) + n.mkdir_p(xstate .. pathsep .. (is_os('win') and 'nvim-data' or 'nvim')) end) teardown(function() - t.rmdir(xstate) + n.rmdir(xstate) end) before_each(function() diff --git a/test/functional/lua/snippet_spec.lua b/test/functional/lua/snippet_spec.lua index 4dcba42e65..74f0869200 100644 --- a/test/functional/lua/snippet_spec.lua +++ b/test/functional/lua/snippet_spec.lua @@ -1,15 +1,16 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() -local buf_lines = t.buf_lines -local clear = t.clear +local buf_lines = n.buf_lines +local clear = n.clear local eq = t.eq -local exec_lua = t.exec_lua -local feed = t.feed -local api = t.api -local fn = t.fn +local exec_lua = n.exec_lua +local feed = n.feed +local api = n.api +local fn = n.fn local matches = t.matches local pcall_err = t.pcall_err -local poke_eventloop = t.poke_eventloop +local poke_eventloop = n.poke_eventloop local retry = t.retry describe('vim.snippet', function() diff --git a/test/functional/lua/spell_spec.lua b/test/functional/lua/spell_spec.lua index f2a81a2578..af7d08b390 100644 --- a/test/functional/lua/spell_spec.lua +++ b/test/functional/lua/spell_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local pcall_err = t.pcall_err diff --git a/test/functional/lua/system_spec.lua b/test/functional/lua/system_spec.lua index 6730eb98eb..e72a009d2e 100644 --- a/test/functional/lua/system_spec.lua +++ b/test/functional/lua/system_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local function system_sync(cmd, opts) diff --git a/test/functional/lua/text_spec.lua b/test/functional/lua/text_spec.lua index d918ff7918..9e77953c8c 100644 --- a/test/functional/lua/text_spec.lua +++ b/test/functional/lua/text_spec.lua @@ -1,5 +1,7 @@ -local t = require('test.functional.testutil')() -local clear = t.clear +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear local eq = t.eq describe('vim.text', function() diff --git a/test/functional/lua/thread_spec.lua b/test/functional/lua/thread_spec.lua index ce869291a2..780057b580 100644 --- a/test/functional/lua/thread_spec.lua +++ b/test/functional/lua/thread_spec.lua @@ -1,11 +1,13 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') -local assert_alive = t.assert_alive -local clear = t.clear -local feed = t.feed + +local assert_alive = n.assert_alive +local clear = n.clear +local feed = n.feed local eq = t.eq -local exec_lua = t.exec_lua -local next_msg = t.next_msg +local exec_lua = n.exec_lua +local next_msg = n.next_msg local NIL = vim.NIL local pcall_err = t.pcall_err diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index d6572f9ae5..5fe51a2c35 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -1,12 +1,14 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') + local eq = t.eq -local exec_lua = t.exec_lua -local clear = t.clear -local feed = t.feed -local fn = t.fn +local exec_lua = n.exec_lua +local clear = n.clear +local feed = n.feed +local fn = n.fn local assert_log = t.assert_log -local check_close = t.check_close +local check_close = n.check_close local testlog = 'Xtest_lua_ui_event_log' @@ -112,7 +114,7 @@ describe('vim.ui_attach', function() it('does not crash on exit', function() fn.system({ - t.nvim_prog, + n.nvim_prog, '-u', 'NONE', '-i', @@ -124,7 +126,7 @@ describe('vim.ui_attach', function() '--cmd', 'quitall!', }) - eq(0, t.eval('v:shell_error')) + eq(0, n.eval('v:shell_error')) end) it('can receive accurate message kinds even if they are history', function() diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index 2472725c56..d69e893c96 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -1,13 +1,15 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + local eq = t.eq local ok = t.ok -local exec_lua = t.exec_lua -local clear = t.clear -local feed = t.feed -local eval = t.eval +local exec_lua = n.exec_lua +local clear = n.clear +local feed = n.feed +local eval = n.eval local is_ci = t.is_ci local is_os = t.is_os -local poke_eventloop = t.poke_eventloop +local poke_eventloop = n.poke_eventloop describe('vim.ui', function() before_each(function() diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua index 6cce83005c..553afb35d3 100644 --- a/test/functional/lua/uri_spec.lua +++ b/test/functional/lua/uri_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local is_os = t.is_os local skip = t.skip diff --git a/test/functional/lua/version_spec.lua b/test/functional/lua/version_spec.lua index ca275f6738..4ce8fb8dfe 100644 --- a/test/functional/lua/version_spec.lua +++ b/test/functional/lua/version_spec.lua @@ -1,11 +1,13 @@ -local t = require('test.functional.testutil')() -local clear = t.clear +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear local eq = t.eq local ok = t.ok -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua local matches = t.matches local pcall_err = t.pcall_err -local fn = t.fn +local fn = n.fn local function v(ver) return vim.version._version(ver) diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index bb8b43caf7..0f51831d52 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -1,32 +1,33 @@ -- Test suite for testing interactions with API bindings -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') -local nvim_prog = t.nvim_prog -local fn = t.fn -local api = t.api -local command = t.command +local nvim_prog = n.nvim_prog +local fn = n.fn +local api = n.api +local command = n.command local dedent = t.dedent -local insert = t.insert -local clear = t.clear +local insert = n.insert +local clear = n.clear local eq = t.eq local ok = t.ok local pesc = vim.pesc -local eval = t.eval -local feed = t.feed +local eval = n.eval +local feed = n.feed local pcall_err = t.pcall_err -local exec_lua = t.exec_lua +local exec_lua = n.exec_lua local matches = t.matches -local exec = t.exec +local exec = n.exec local NIL = vim.NIL local retry = t.retry -local next_msg = t.next_msg +local next_msg = n.next_msg local remove_trace = t.remove_trace -local mkdir_p = t.mkdir_p -local rmdir = t.rmdir +local mkdir_p = n.mkdir_p +local rmdir = n.rmdir local write_file = t.write_file -local poke_eventloop = t.poke_eventloop -local assert_alive = t.assert_alive +local poke_eventloop = n.poke_eventloop +local assert_alive = n.assert_alive describe('lua stdlib', function() before_each(clear) @@ -1574,7 +1575,7 @@ describe('lua stdlib', function() eq(NIL, exec_lua([[return vim.g.Unknown_script_func]])) -- Check if autoload works properly - local pathsep = t.get_pathsep() + local pathsep = n.get_pathsep() local xconfig = 'Xhome' .. pathsep .. 'Xconfig' local xdata = 'Xhome' .. pathsep .. 'Xdata' local autoload_folder = table.concat({ xconfig, 'nvim', 'autoload' }, pathsep) @@ -4076,7 +4077,7 @@ describe('vim.keymap', function() feed('asdf\n') eq(1, exec_lua [[return GlobalCount]]) - eq('\nNo mapping found', t.exec_capture('nmap asdf')) + eq('\nNo mapping found', n.exec_capture('nmap asdf')) end) it('works with buffer-local mappings', function() @@ -4100,7 +4101,7 @@ describe('vim.keymap', function() feed('asdf\n') eq(1, exec_lua [[return GlobalCount]]) - eq('\nNo mapping found', t.exec_capture('nmap asdf')) + eq('\nNo mapping found', n.exec_capture('nmap asdf')) end) it('does not mutate the opts parameter', function() diff --git a/test/functional/lua/watch_spec.lua b/test/functional/lua/watch_spec.lua index deb8c8955b..bd8faadf5b 100644 --- a/test/functional/lua/watch_spec.lua +++ b/test/functional/lua/watch_spec.lua @@ -1,7 +1,9 @@ -local t = require('test.functional.testutil')() +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + local eq = t.eq -local exec_lua = t.exec_lua -local clear = t.clear +local exec_lua = n.exec_lua +local clear = n.clear local is_ci = t.is_ci local is_os = t.is_os local skip = t.skip @@ -24,7 +26,7 @@ describe('vim._watch', function() if watchfunc == 'fswatch' then skip(is_os('win'), 'not supported on windows') skip(is_os('mac'), 'flaky test on mac') - skip(not is_ci() and t.fn.executable('fswatch') == 0, 'fswatch not installed and not on CI') + skip(not is_ci() and n.fn.executable('fswatch') == 0, 'fswatch not installed and not on CI') end if watchfunc == 'watch' then diff --git a/test/functional/lua/xdiff_spec.lua b/test/functional/lua/xdiff_spec.lua index 0e5dd91fb8..d5589c1f13 100644 --- a/test/functional/lua/xdiff_spec.lua +++ b/test/functional/lua/xdiff_spec.lua @@ -1,6 +1,8 @@ -local t = require('test.functional.testutil')() -local clear = t.clear -local exec_lua = t.exec_lua +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local exec_lua = n.exec_lua local eq = t.eq local pcall_err = t.pcall_err |