From 276c2da28616d7a4f504c328dbb8857d38ab7a4a Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 6 Oct 2019 19:40:36 -0700 Subject: API: nvim_source: fix multiline input - DOCMD_REPEAT is needed to source all lines of input. - Fix ":verbose set {option}?" by handling SID_STR in get_scriptname(). closes #8722 --- test/functional/api/vim_spec.lua | 131 ++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 58 deletions(-) (limited to 'test/functional/api/vim_spec.lua') diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 14ed474eb1..a01ef2d6dd 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -16,6 +16,7 @@ local parse_context = helpers.parse_context local request = helpers.request local source = helpers.source local next_msg = helpers.next_msg +local write_file = helpers.write_file local pcall_err = helpers.pcall_err local format_string = helpers.format_string @@ -75,80 +76,94 @@ describe('API', function() end) describe('nvim_source', function() - it('works with a one-liner', function() + it('one-line input', function() nvim('source', "let x1 = 'a'") - eq(nvim('get_var', 'x1'), 'a') + eq('a', nvim('get_var', 'x1')) end) - it('works with stray newline character', function() - nvim('source', "let x2 = 'a'\n") - eq(nvim('get_var', 'x2'),'a') - end) - - it('works with multiline command', function() - nvim('source', 'lua <