diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-12-10 02:18:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-10 02:18:15 +0100 |
commit | 7c513d646d87eb3e4ed4917d5a3a7b9163371fae (patch) | |
tree | badf3d0cad34dc28ecd1d87b9f7b38843677021d /test/functional/eval/execute_spec.lua | |
parent | 5082af415f762e5f5974214e32deff883141bfc2 (diff) | |
parent | 4abe9afbf67cec620fde9e47cb3df92f60e1cca9 (diff) | |
download | rneovim-7c513d646d87eb3e4ed4917d5a3a7b9163371fae.tar.gz rneovim-7c513d646d87eb3e4ed4917d5a3a7b9163371fae.tar.bz2 rneovim-7c513d646d87eb3e4ed4917d5a3a7b9163371fae.zip |
Merge #5396 from justinmk/tui-throttle
throttle shell output to maintain responsiveness
Diffstat (limited to 'test/functional/eval/execute_spec.lua')
-rw-r--r-- | test/functional/eval/execute_spec.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index b5b481435a..fc13c0a72b 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -12,16 +12,16 @@ local feed = helpers.feed describe('execute()', function() before_each(clear) - it('returns the same result with :redir', function() + it('captures the same result as :redir', function() eq(redir_exec('messages'), funcs.execute('messages')) end) - it('returns the output of the commands if the argument is List', function() + it('captures the concatenated outputs of a List of commands', function() eq("foobar", funcs.execute({'echon "foo"', 'echon "bar"'})) eq("\nfoo\nbar", funcs.execute({'echo "foo"', 'echo "bar"'})) end) - it('supports the nested redirection', function() + it('supports nested redirection', function() source([[ function! g:Foo() let a = '' @@ -43,17 +43,17 @@ describe('execute()', function() eq('42', funcs.execute([[echon execute("echon execute('echon 42')")]])) end) - it('returns the transformed string', function() + it('captures a transformed string', function() eq('^A', funcs.execute('echon "\\<C-a>"')) end) - it('returns the empty string if the argument list is empty', function() + it('returns empty string if the argument list is empty', function() eq('', funcs.execute({})) eq(0, exc_exec('let g:ret = execute(v:_null_list)')) eq('', eval('g:ret')) end) - it('returns the errors', function() + it('captures errors', function() local ret ret = exc_exec('call execute(0.0)') eq('Vim(call):E806: using Float as a String', ret) @@ -69,6 +69,11 @@ describe('execute()', function() eq('Vim(call):E729: using Funcref as a String', ret) end) + -- This matches Vim behavior. + it('does not capture shell-command output', function() + eq('\n:!echo "foo"\13\n', funcs.execute('!echo "foo"')) + end) + it('silences command run inside', function() local screen = Screen.new(40, 5) screen:attach() |