From a7bbda121d035d050b449b4dc63bd6ae027e248d Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 25 Mar 2024 19:06:28 +0000 Subject: fix(test): typing --- test/functional/lua/overrides_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/lua/overrides_spec.lua') diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index ecbdde3bfd..428b2e0921 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -195,7 +195,7 @@ describe('print', function() end) describe('debug.debug', function() - local screen + local screen --- @type test.functional.ui.screen before_each(function() screen = Screen.new() -- cgit From 7035125b2b26aa68fcfb7cda39377ac79926a0f9 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 8 Apr 2024 11:03:20 +0200 Subject: test: improve test conventions Work on https://github.com/neovim/neovim/issues/27004. --- test/functional/lua/overrides_spec.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'test/functional/lua/overrides_spec.lua') diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 428b2e0921..9b69857cd4 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -1,19 +1,19 @@ -- Test for Vim overrides of lua built-ins -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 eq = t.eq local NIL = vim.NIL -local feed = helpers.feed -local clear = helpers.clear -local fn = helpers.fn -local api = helpers.api -local command = helpers.command -local write_file = helpers.write_file -local exec_capture = helpers.exec_capture -local exec_lua = helpers.exec_lua -local pcall_err = helpers.pcall_err -local is_os = helpers.is_os +local feed = t.feed +local clear = t.clear +local fn = t.fn +local api = t.api +local command = t.command +local write_file = t.write_file +local exec_capture = t.exec_capture +local exec_lua = t.exec_lua +local pcall_err = t.pcall_err +local is_os = t.is_os local fname = 'Xtest-functional-lua-overrides-luafile' -- cgit From 81fc27124b9e1b375e0ce9605ae69c3c2a2d9222 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 9 Apr 2024 12:26:16 +0100 Subject: refactor(test): inject after_each differently --- test/functional/lua/overrides_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/lua/overrides_spec.lua') diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 9b69857cd4..7f325da307 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -1,5 +1,5 @@ -- Test for Vim overrides of lua built-ins -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq -- cgit From 052498ed42780a76daea589d063cd8947a894673 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 20 Apr 2024 17:44:13 +0200 Subject: test: improve test conventions Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004. --- test/functional/lua/overrides_spec.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/functional/lua/overrides_spec.lua') 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 -- cgit