Skip to content

Commit 46f479c

Browse files
committed
patch 8.2.1965: Vim9: tests fail without the channel feature
Problem: Vim9: tests fail without the channel feature. Solution: Check if the channel feature is present. (Dominique Pellé, closes 7270)
1 parent faebda8 commit 46f479c

2 files changed

Lines changed: 29 additions & 19 deletions

File tree

src/testdir/test_vim9_expr.vim

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,26 +1292,26 @@ func Test_expr5_fails()
12921292
call CheckDefFailure(["var x = '1' ..'2'"], msg, 1)
12931293
call CheckDefFailure(["var x = '1'.. '2'"], msg, 1)
12941294

1295-
call CheckDefFailure(["var x = 0z1122 + 33"], 'E1051', 1)
1296-
call CheckDefFailure(["var x = 0z1122 + [3]"], 'E1051', 1)
1297-
call CheckDefFailure(["var x = 0z1122 + 'asd'"], 'E1051', 1)
1298-
call CheckDefFailure(["var x = 33 + 0z1122"], 'E1051', 1)
1299-
call CheckDefFailure(["var x = [3] + 0z1122"], 'E1051', 1)
1300-
call CheckDefFailure(["var x = 'asdf' + 0z1122"], 'E1051', 1)
1301-
call CheckDefFailure(["var x = 6 + xxx"], 'E1001', 1)
1302-
1303-
call CheckDefFailure(["var x = 'a' .. [1]"], 'E1105', 1)
1304-
call CheckDefFailure(["var x = 'a' .. #{a: 1}"], 'E1105', 1)
1305-
call CheckDefFailure(["var x = 'a' .. test_void()"], 'E1105', 1)
1306-
call CheckDefFailure(["var x = 'a' .. 0z32"], 'E1105', 1)
1307-
call CheckDefFailure(["var x = 'a' .. function('len')"], 'E1105', 1)
1308-
call CheckDefFailure(["var x = 'a' .. function('len', ['a'])"], 'E1105', 1)
1295+
call CheckDefFailure(["var x = 0z1122 + 33"], 'E1051:', 1)
1296+
call CheckDefFailure(["var x = 0z1122 + [3]"], 'E1051:', 1)
1297+
call CheckDefFailure(["var x = 0z1122 + 'asd'"], 'E1051:', 1)
1298+
call CheckDefFailure(["var x = 33 + 0z1122"], 'E1051:', 1)
1299+
call CheckDefFailure(["var x = [3] + 0z1122"], 'E1051:', 1)
1300+
call CheckDefFailure(["var x = 'asdf' + 0z1122"], 'E1051:', 1)
1301+
call CheckDefFailure(["var x = 6 + xxx"], 'E1001:', 1)
1302+
1303+
call CheckDefFailure(["var x = 'a' .. [1]"], 'E1105:', 1)
1304+
call CheckDefFailure(["var x = 'a' .. #{a: 1}"], 'E1105:', 1)
1305+
call CheckDefFailure(["var x = 'a' .. test_void()"], 'E1105:', 1)
1306+
call CheckDefFailure(["var x = 'a' .. 0z32"], 'E1105:', 1)
1307+
call CheckDefFailure(["var x = 'a' .. function('len')"], 'E1105:', 1)
1308+
call CheckDefFailure(["var x = 'a' .. function('len', ['a'])"], 'E1105:', 1)
13091309
endfunc
13101310

13111311
func Test_expr5_fails_channel()
13121312
CheckFeature channel
1313-
call CheckDefFailure(["var x = 'a' .. test_null_job()"], 'E1105', 1)
1314-
call CheckDefFailure(["var x = 'a' .. test_null_channel()"], 'E1105', 1)
1313+
call CheckDefFailure(["var x = 'a' .. test_null_job()"], 'E1105:', 1)
1314+
call CheckDefFailure(["var x = 'a' .. test_null_channel()"], 'E1105:', 1)
13151315
endfunc
13161316

13171317
" test multiply, divide, modulo
@@ -1352,7 +1352,7 @@ def Test_expr6()
13521352
* yf[0])
13531353
endif
13541354

1355-
CheckDefFailure(["var x = 6 * xxx"], 'E1001', 1)
1355+
CheckDefFailure(["var x = 6 * xxx"], 'E1001:', 1)
13561356
enddef
13571357

13581358
def Test_expr6_vim9script()
@@ -1757,7 +1757,11 @@ def Test_expr7_list_vim9script()
17571757
enddef
17581758
var list = [Failing]
17591759
END
1760-
CheckScriptFailure(lines, 'E119:', 1)
1760+
if has('channel')
1761+
CheckScriptFailure(lines, 'E119:', 1)
1762+
else
1763+
CheckScriptFailure(lines, 'E117:', 1)
1764+
endif
17611765
enddef
17621766

17631767
def LambdaWithComments(): func
@@ -2028,7 +2032,11 @@ def Test_expr7_dict_vim9script()
20282032
enddef
20292033
var dict = #{name: Failing}
20302034
END
2031-
CheckScriptFailure(lines, 'E119:', 1)
2035+
if has('channel')
2036+
CheckScriptFailure(lines, 'E119:', 1)
2037+
else
2038+
CheckScriptFailure(lines, 'E117:', 1)
2039+
endif
20322040
enddef
20332041

20342042
let g:oneString = 'one'

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
1965,
753755
/**/
754756
1964,
755757
/**/

0 commit comments

Comments
 (0)