comparison src/testdir/test_vim9_expr.vim @ 22836:b129f28b0e35 v8.2.1965

patch 8.2.1965: Vim9: tests fail without the channel feature Commit: https://github.com/vim/vim/commit/46f479c756c0255e3b6d473590c1857678eff5c6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 7 13:09:18 2020 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Nov 2020 13:15:03 +0100
parents 96dbb61a54c2
children 53acb89ec9f2
comparison
equal deleted inserted replaced
22835:1cdaabe8a505 22836:b129f28b0e35
1290 let msg = "White space required before and after '..'" 1290 let msg = "White space required before and after '..'"
1291 call CheckDefFailure(["var x = '1'..'2'"], msg, 1) 1291 call CheckDefFailure(["var x = '1'..'2'"], msg, 1)
1292 call CheckDefFailure(["var x = '1' ..'2'"], msg, 1) 1292 call CheckDefFailure(["var x = '1' ..'2'"], msg, 1)
1293 call CheckDefFailure(["var x = '1'.. '2'"], msg, 1) 1293 call CheckDefFailure(["var x = '1'.. '2'"], msg, 1)
1294 1294
1295 call CheckDefFailure(["var x = 0z1122 + 33"], 'E1051', 1) 1295 call CheckDefFailure(["var x = 0z1122 + 33"], 'E1051:', 1)
1296 call CheckDefFailure(["var x = 0z1122 + [3]"], 'E1051', 1) 1296 call CheckDefFailure(["var x = 0z1122 + [3]"], 'E1051:', 1)
1297 call CheckDefFailure(["var x = 0z1122 + 'asd'"], 'E1051', 1) 1297 call CheckDefFailure(["var x = 0z1122 + 'asd'"], 'E1051:', 1)
1298 call CheckDefFailure(["var x = 33 + 0z1122"], 'E1051', 1) 1298 call CheckDefFailure(["var x = 33 + 0z1122"], 'E1051:', 1)
1299 call CheckDefFailure(["var x = [3] + 0z1122"], 'E1051', 1) 1299 call CheckDefFailure(["var x = [3] + 0z1122"], 'E1051:', 1)
1300 call CheckDefFailure(["var x = 'asdf' + 0z1122"], 'E1051', 1) 1300 call CheckDefFailure(["var x = 'asdf' + 0z1122"], 'E1051:', 1)
1301 call CheckDefFailure(["var x = 6 + xxx"], 'E1001', 1) 1301 call CheckDefFailure(["var x = 6 + xxx"], 'E1001:', 1)
1302 1302
1303 call CheckDefFailure(["var x = 'a' .. [1]"], 'E1105', 1) 1303 call CheckDefFailure(["var x = 'a' .. [1]"], 'E1105:', 1)
1304 call CheckDefFailure(["var x = 'a' .. #{a: 1}"], 'E1105', 1) 1304 call CheckDefFailure(["var x = 'a' .. #{a: 1}"], 'E1105:', 1)
1305 call CheckDefFailure(["var x = 'a' .. test_void()"], 'E1105', 1) 1305 call CheckDefFailure(["var x = 'a' .. test_void()"], 'E1105:', 1)
1306 call CheckDefFailure(["var x = 'a' .. 0z32"], 'E1105', 1) 1306 call CheckDefFailure(["var x = 'a' .. 0z32"], 'E1105:', 1)
1307 call CheckDefFailure(["var x = 'a' .. function('len')"], 'E1105', 1) 1307 call CheckDefFailure(["var x = 'a' .. function('len')"], 'E1105:', 1)
1308 call CheckDefFailure(["var x = 'a' .. function('len', ['a'])"], 'E1105', 1) 1308 call CheckDefFailure(["var x = 'a' .. function('len', ['a'])"], 'E1105:', 1)
1309 endfunc 1309 endfunc
1310 1310
1311 func Test_expr5_fails_channel() 1311 func Test_expr5_fails_channel()
1312 CheckFeature channel 1312 CheckFeature channel
1313 call CheckDefFailure(["var x = 'a' .. test_null_job()"], 'E1105', 1) 1313 call CheckDefFailure(["var x = 'a' .. test_null_job()"], 'E1105:', 1)
1314 call CheckDefFailure(["var x = 'a' .. test_null_channel()"], 'E1105', 1) 1314 call CheckDefFailure(["var x = 'a' .. test_null_channel()"], 'E1105:', 1)
1315 endfunc 1315 endfunc
1316 1316
1317 " test multiply, divide, modulo 1317 " test multiply, divide, modulo
1318 def Test_expr6() 1318 def Test_expr6()
1319 assert_equal(36, 6 * 6) 1319 assert_equal(36, 6 * 6)
1350 + yf[0]) 1350 + yf[0])
1351 assert_equal(6.0, xf[0] 1351 assert_equal(6.0, xf[0]
1352 * yf[0]) 1352 * yf[0])
1353 endif 1353 endif
1354 1354
1355 CheckDefFailure(["var x = 6 * xxx"], 'E1001', 1) 1355 CheckDefFailure(["var x = 6 * xxx"], 'E1001:', 1)
1356 enddef 1356 enddef
1357 1357
1358 def Test_expr6_vim9script() 1358 def Test_expr6_vim9script()
1359 # check line continuation 1359 # check line continuation
1360 var lines =<< trim END 1360 var lines =<< trim END
1755 def Failing() 1755 def Failing()
1756 job_stop() 1756 job_stop()
1757 enddef 1757 enddef
1758 var list = [Failing] 1758 var list = [Failing]
1759 END 1759 END
1760 CheckScriptFailure(lines, 'E119:', 1) 1760 if has('channel')
1761 CheckScriptFailure(lines, 'E119:', 1)
1762 else
1763 CheckScriptFailure(lines, 'E117:', 1)
1764 endif
1761 enddef 1765 enddef
1762 1766
1763 def LambdaWithComments(): func 1767 def LambdaWithComments(): func
1764 return {x -> 1768 return {x ->
1765 # some comment 1769 # some comment
2026 def Failing() 2030 def Failing()
2027 job_stop() 2031 job_stop()
2028 enddef 2032 enddef
2029 var dict = #{name: Failing} 2033 var dict = #{name: Failing}
2030 END 2034 END
2031 CheckScriptFailure(lines, 'E119:', 1) 2035 if has('channel')
2036 CheckScriptFailure(lines, 'E119:', 1)
2037 else
2038 CheckScriptFailure(lines, 'E117:', 1)
2039 endif
2032 enddef 2040 enddef
2033 2041
2034 let g:oneString = 'one' 2042 let g:oneString = 'one'
2035 2043
2036 def Test_expr_member() 2044 def Test_expr_member()