0
0
mirror of https://github.com/vim/vim.git synced 2025-11-10 10:47:23 -05:00

patch 8.2.3232: system() does not work without a second argument

Problem:    system() does not work without a second argument.
Solution:   Do not require a second argument. (Yegappan Lakshmanan,
            closes #8651, closes #8650)
This commit is contained in:
Yegappan Lakshmanan
2021-07-28 11:51:48 +02:00
committed by Bram Moolenaar
parent 9088784972
commit 7e6a2a64f0
5 changed files with 21 additions and 1 deletions

View File

@@ -3290,11 +3290,17 @@ enddef
def Test_system()
CheckDefAndScriptFailure2(['system(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
CheckDefAndScriptFailure2(['system("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String or List required for argument 2')
assert_equal("123\n", system('echo 123'))
enddef
def Test_systemlist()
CheckDefAndScriptFailure2(['systemlist(1)'], 'E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1')
CheckDefAndScriptFailure2(['systemlist("a", {})'], 'E1013: Argument 2: type mismatch, expected string but got dict<unknown>', 'E1224: String or List required for argument 2')
if has('win32')
call assert_equal(["123\r"], systemlist('echo 123'))
else
call assert_equal(['123'], systemlist('echo 123'))
endif
enddef
def Test_tabpagebuflist()