1
0
forked from aniani/vim

patch 8.2.0103: using null object with execute() has strange effects

Problem:    Using null object with execute() has strange effects.
Solution:   Give an error message ofr Job and Channel.
This commit is contained in:
Bram Moolenaar
2020-01-08 19:32:18 +01:00
parent da292b07af
commit e2a8f0773e
5 changed files with 22 additions and 4 deletions

View File

@@ -38,8 +38,6 @@ func Test_execute_string()
call assert_equal("\nsomething", execute('echo "something"', 'silent!'))
call assert_equal("", execute('burp', 'silent!'))
call assert_fails('call execute("echo \"x\"", 3.4)', 'E806:')
call assert_equal("", execute(test_null_string()))
endfunc
func Test_execute_list()
@@ -50,7 +48,6 @@ func Test_execute_list()
call assert_equal("\n0\n1\n2\n3", execute(l))
call assert_equal("", execute([]))
call assert_equal("", execute(test_null_list()))
endfunc
func Test_execute_does_not_change_col()
@@ -132,3 +129,15 @@ func Test_win_execute_other_tab()
tabclose
unlet xyz
endfunc
func Test_execute_null()
call assert_equal("", execute(test_null_string()))
call assert_equal("", execute(test_null_list()))
call assert_fails('call execute(test_null_dict())', 'E731:')
call assert_fails('call execute(test_null_blob())', 'E976:')
call assert_fails('call execute(test_null_partial())','E729:')
if has('job')
call assert_fails('call execute(test_null_job())', 'E908:')
call assert_fails('call execute(test_null_channel())', 'E908:')
endif
endfunc