From 4e7d85e6356d88944a60c447a9754b8b37407c12 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 21 Jan 2018 19:58:19 +0100 Subject: shell: update `execute('!cmd')` test to new behavior And similarly nvim_command_output test --- test/functional/eval/execute_spec.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/functional/eval/execute_spec.lua') diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index 91966ed3dd..c866359520 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) +local global_helpers = require('test.helpers') local eq = helpers.eq local eval = helpers.eval local clear = helpers.clear @@ -9,6 +10,7 @@ local funcs = helpers.funcs local Screen = require('test.functional.ui.screen') local command = helpers.command local feed = helpers.feed +local uname = global_helpers.uname describe('execute()', function() before_each(clear) @@ -118,9 +120,11 @@ describe('execute()', function() feed('') end) - -- This matches Vim behavior. - it('does not capture shell-command output', function() - eq('\n:!echo "foo"\13\n', funcs.execute('!echo "foo"')) + -- This deviates from vim behavior, but is consistent + -- with how nvim currently displays the output. + it('does capture shell-command output', function() + local win_lf = (uname() == 'Windows' and '\13') or '' + eq('\n:!echo foo\r\n\nfoo'..win_lf..'\n', funcs.execute('!echo foo')) end) describe('{silent} argument', function() -- cgit From 352a51e8313d05c4701f468a79540a2410c77b23 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 10 May 2017 15:04:49 +0200 Subject: test: :! print binary data, control chars closes #5442 closes #4142 ref #6618 ref #4376 ref #7844 ref #2958 ref #4338 --- test/functional/eval/execute_spec.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/functional/eval/execute_spec.lua') diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index c866359520..183884a51e 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -1,5 +1,4 @@ local helpers = require('test.functional.helpers')(after_each) -local global_helpers = require('test.helpers') local eq = helpers.eq local eval = helpers.eval local clear = helpers.clear @@ -10,7 +9,7 @@ local funcs = helpers.funcs local Screen = require('test.functional.ui.screen') local command = helpers.command local feed = helpers.feed -local uname = global_helpers.uname +local iswin = helpers.iswin describe('execute()', function() before_each(clear) @@ -123,7 +122,7 @@ describe('execute()', function() -- This deviates from vim behavior, but is consistent -- with how nvim currently displays the output. it('does capture shell-command output', function() - local win_lf = (uname() == 'Windows' and '\13') or '' + local win_lf = iswin() and '\13' or '' eq('\n:!echo foo\r\n\nfoo'..win_lf..'\n', funcs.execute('!echo foo')) end) -- cgit From 98e71123900fbdf26a16a43297a1f58118cde41b Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 31 Mar 2018 11:12:27 +0200 Subject: msg: do not scroll entire screen (#8088) --- test/functional/eval/execute_spec.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'test/functional/eval/execute_spec.lua') diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index 183884a51e..925e311c7d 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -106,16 +106,22 @@ describe('execute()', function() end) it('does not corrupt the command display #5422', function() - local screen = Screen.new(70, 5) + local screen = Screen.new(70, 7) screen:attach() feed(':echo execute("hi ErrorMsg")') screen:expect([[ - ~ | - ~ | + | + {1:~ }| + {1:~ }| + {2: }| :echo execute("hi ErrorMsg") | ErrorMsg xxx ctermfg=15 ctermbg=1 guifg=White guibg=Red | - Press ENTER or type command to continue^ | - ]]) + {3:Press ENTER or type command to continue}^ | + ]], { + [1] = {bold = true, foreground = Screen.colors.Blue1}, + [2] = {bold = true, reverse = true}, + [3] = {bold = true, foreground = Screen.colors.SeaGreen4}, + }) feed('') end) -- cgit