You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
patch 8.2.3181: Vim9: builtin function test fails without channel feature
Problem: Vim9: builtin function test fails without channel feature.
Solution: Add feature checks. (Dominique Pellé, closes #8586) Make feature
checks more consistent.
Copy file name to clipboardExpand all lines: src/testdir/test_vim9_builtin.vim
+35-15Lines changed: 35 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -398,9 +398,13 @@ def Test_ch_close_in()
398
398
enddef
399
399
400
400
defTest_ch_getjob()
401
-
CheckDefAndScriptFailure2(['ch_getjob(1)'], 'E1013: Argument 1: type mismatch, expected channel but got number', 'E475: Invalid argument:')
402
-
CheckDefAndScriptFailure2(['ch_getjob({"a": 10})'], 'E1013: Argument 1: type mismatch, expected channel but got dict<number>', 'E731: Using a Dictionary as a String')
403
-
assert_equal(0, ch_getjob(test_null_channel()))
401
+
if!has('channel')
402
+
CheckFeature channel
403
+
else
404
+
CheckDefAndScriptFailure2(['ch_getjob(1)'], 'E1013: Argument 1: type mismatch, expected channel but got number', 'E475: Invalid argument:')
405
+
CheckDefAndScriptFailure2(['ch_getjob({"a": 10})'], 'E1013: Argument 1: type mismatch, expected channel but got dict<number>', 'E731: Using a Dictionary as a String')
406
+
assert_equal(0, ch_getjob(test_null_channel()))
407
+
endif
404
408
enddef
405
409
406
410
defTest_ch_info()
@@ -1425,17 +1429,27 @@ def Test_items()
1425
1429
enddef
1426
1430
1427
1431
defTest_job_getchannel()
1428
-
CheckDefAndScriptFailure2(['job_getchannel("a")'], 'E1013: Argument 1: type mismatch, expected job but got string', 'E475: Invalid argument')
1429
-
assert_fails('job_getchannel(test_null_job())', 'E916: not a valid job')
1432
+
if!has('job')
1433
+
CheckFeature job
1434
+
else
1435
+
CheckDefAndScriptFailure2(['job_getchannel("a")'], 'E1013: Argument 1: type mismatch, expected job but got string', 'E475: Invalid argument')
1436
+
assert_fails('job_getchannel(test_null_job())', 'E916: not a valid job')
1437
+
endif
1430
1438
enddef
1431
1439
1432
1440
defTest_job_info()
1433
-
CheckDefAndScriptFailure2(['job_info("a")'], 'E1013: Argument 1: type mismatch, expected job but got string', 'E475: Invalid argument')
1434
-
assert_fails('job_info(test_null_job())', 'E916: not a valid job')
1441
+
if!has('job')
1442
+
CheckFeature job
1443
+
else
1444
+
CheckDefAndScriptFailure2(['job_info("a")'], 'E1013: Argument 1: type mismatch, expected job but got string', 'E475: Invalid argument')
1445
+
assert_fails('job_info(test_null_job())', 'E916: not a valid job')
0 commit comments