From a500c5f808ccf0b678c935f00e0af4503a5bd724 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 5 Apr 2024 18:04:45 +0800 Subject: vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184) Problem: Dialog for file changed outside of Vim not tested. Solution: Add a test. Move FileChangedShell test. Add 'L' flag to feedkeys(). https://github.com/vim/vim/commit/5e66b42aae7c67a3ef67617d4bd43052ac2b73ce Co-authored-by: Bram Moolenaar --- test/functional/vimscript/input_spec.lua | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'test/functional/vimscript/input_spec.lua') diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index b749d5a7f0..d64ae3b0f1 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -8,7 +8,6 @@ local clear = helpers.clear local source = helpers.source local command = helpers.command local exc_exec = helpers.exc_exec -local pcall_err = helpers.pcall_err local async_meths = helpers.async_meths local NIL = vim.NIL @@ -407,7 +406,6 @@ describe('inputdialog()', function() end) describe('confirm()', function() - -- oldtest: Test_confirm() it('works', function() api.nvim_set_option_value('more', false, {}) -- Avoid hit-enter prompt api.nvim_set_option_value('laststatus', 2, {}) @@ -470,20 +468,6 @@ describe('confirm()', function() screen:expect({ any = '%[No Name%]' }) eq(1, api.nvim_get_var('a')) end - - eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call confirm([])')) - eq( - 'Vim(call):E730: Using a List as a String', - pcall_err(command, 'call confirm("Are you sure?", [])') - ) - eq( - 'Vim(call):E745: Using a List as a Number', - pcall_err(command, 'call confirm("Are you sure?", "&Yes\n&No\n", [])') - ) - eq( - 'Vim(call):E730: Using a List as a String', - pcall_err(command, 'call confirm("Are you sure?", "&Yes\n&No\n", 0, [])') - ) end) it('shows dialog even if :silent #8788', function() -- 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/vimscript/input_spec.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/functional/vimscript/input_spec.lua') diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index d64ae3b0f1..0ac22c7320 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -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 eq = helpers.eq -local feed = helpers.feed -local api = helpers.api -local clear = helpers.clear -local source = helpers.source -local command = helpers.command -local exc_exec = helpers.exc_exec -local async_meths = helpers.async_meths +local eq = t.eq +local feed = t.feed +local api = t.api +local clear = t.clear +local source = t.source +local command = t.command +local exc_exec = t.exc_exec +local async_meths = t.async_meths local NIL = vim.NIL local screen -- 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/vimscript/input_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/vimscript/input_spec.lua') diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index 0ac22c7320..e974d71356 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -1,4 +1,4 @@ -local t = require('test.functional.testutil')(after_each) +local t = require('test.functional.testutil')() local Screen = require('test.functional.ui.screen') local eq = t.eq -- 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/vimscript/input_spec.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/functional/vimscript/input_spec.lua') diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index e974d71356..552ae6d5cc 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -1,14 +1,15 @@ -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 feed = t.feed -local api = t.api -local clear = t.clear -local source = t.source -local command = t.command -local exc_exec = t.exc_exec -local async_meths = t.async_meths +local feed = n.feed +local api = n.api +local clear = n.clear +local source = n.source +local command = n.command +local exc_exec = n.exc_exec +local async_meths = n.async_meths local NIL = vim.NIL local screen -- cgit