aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/system_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-09 22:51:59 +0200
committerGitHub <noreply@github.com>2017-04-09 22:51:59 +0200
commitd7fb7de70aee3dff48abc61986818dee86afed07 (patch)
treea9263b8deb57161f2b5315117371af026759c79b /test/functional/eval/system_spec.lua
parentdbdd69e418a3baa4750abc25fae7516a36776e75 (diff)
parentdbe67868b53774443521129ef30d74346592e3bb (diff)
downloadrneovim-d7fb7de70aee3dff48abc61986818dee86afed07.tar.gz
rneovim-d7fb7de70aee3dff48abc61986818dee86afed07.tar.bz2
rneovim-d7fb7de70aee3dff48abc61986818dee86afed07.zip
Merge #6481 from ZyX-I/rename-execute
Rename execute() function to feed_command()
Diffstat (limited to 'test/functional/eval/system_spec.lua')
-rw-r--r--test/functional/eval/system_spec.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua
index ee75b593ff..bf95752e3b 100644
--- a/test/functional/eval/system_spec.lua
+++ b/test/functional/eval/system_spec.lua
@@ -1,6 +1,8 @@
local helpers = require('test.functional.helpers')(after_each)
-local eq, call, clear, eval, execute, feed, nvim =
- helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.execute,
+
+local nvim_dir = helpers.nvim_dir
+local eq, call, clear, eval, feed_command, feed, nvim =
+ helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command,
helpers.feed, helpers.nvim
local Screen = require('test.functional.ui.screen')
@@ -31,7 +33,7 @@ describe('system()', function()
describe('command passed as a List', function()
local function printargs_path()
- return helpers.nvim_dir..'/printargs-test'
+ return nvim_dir..'/printargs-test'
.. (helpers.os_name() == 'windows' and '.exe' or '')
end
@@ -43,10 +45,10 @@ describe('system()', function()
it('parameter validation does NOT modify v:shell_error', function()
-- 1. Call system() with invalid parameters.
-- 2. Assert that v:shell_error was NOT set.
- execute('call system({})')
+ feed_command('call system({})')
eq('E475: Invalid argument: expected String or List', eval('v:errmsg'))
eq(0, eval('v:shell_error'))
- execute('call system([])')
+ feed_command('call system([])')
eq('E474: Invalid argument', eval('v:errmsg'))
eq(0, eval('v:shell_error'))
@@ -57,9 +59,9 @@ describe('system()', function()
-- 1. Call system() with invalid parameters.
-- 2. Assert that v:shell_error was NOT modified.
- execute('call system({})')
+ feed_command('call system({})')
eq(old_val, eval('v:shell_error'))
- execute('call system([])')
+ feed_command('call system([])')
eq(old_val, eval('v:shell_error'))
end)
@@ -182,7 +184,7 @@ describe('system()', function()
end)
it('to backgrounded command does not crash', function()
-- This is indeterminate, just exercise the codepath. May get E5677.
- execute('call system("echo -n echoed &")')
+ feed_command('call system("echo -n echoed &")')
local v_errnum = string.match(eval("v:errmsg"), "^E%d*:")
if v_errnum then
eq("E5677:", v_errnum)
@@ -197,7 +199,7 @@ describe('system()', function()
end)
it('to backgrounded command does not crash', function()
-- This is indeterminate, just exercise the codepath. May get E5677.
- execute('call system("cat - &")')
+ feed_command('call system("cat - &")')
local v_errnum = string.match(eval("v:errmsg"), "^E%d*:")
if v_errnum then
eq("E5677:", v_errnum)