diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-10 19:12:56 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-10 19:12:56 +0300 |
commit | 22fb9d8d25f5354bb878b953ba49b439961c8476 (patch) | |
tree | d3c21e80d09f7b1cf1a7c525643c2e20fb5a925e /test/functional/eval/system_spec.lua | |
parent | acc52a953b99f78435c34337b8ca9b6716a057a1 (diff) | |
parent | 9aface8c4d1edd25d4fed3e099e3c2c02b0a282a (diff) | |
download | rneovim-22fb9d8d25f5354bb878b953ba49b439961c8476.tar.gz rneovim-22fb9d8d25f5354bb878b953ba49b439961c8476.tar.bz2 rneovim-22fb9d8d25f5354bb878b953ba49b439961c8476.zip |
Merge branch 'master' into 1476-changes
Diffstat (limited to 'test/functional/eval/system_spec.lua')
-rw-r--r-- | test/functional/eval/system_spec.lua | 20 |
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) |