comparison src/testdir/test_vim9_func.vim @ 24685:04205b7d67d5 v8.2.2881

patch 8.2.2881: various pieces of code not covered by tests Commit: https://github.com/vim/vim/commit/611728f80604dd56960e8c197e5749d203c8feb1 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon May 24 15:15:47 2021 +0200 patch 8.2.2881: various pieces of code not covered by tests Problem: Various pieces of code not covered by tests. Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8245)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 May 2021 15:30:03 +0200
parents 5dea95170907
children 13efbfc53054
comparison
equal deleted inserted replaced
24684:1706f44ede8e 24685:04205b7d67d5
884 def Test_lambda_return_type() 884 def Test_lambda_return_type()
885 var lines =<< trim END 885 var lines =<< trim END
886 var Ref = (): => 123 886 var Ref = (): => 123
887 END 887 END
888 CheckDefAndScriptFailure(lines, 'E1157:', 1) 888 CheckDefAndScriptFailure(lines, 'E1157:', 1)
889
890 # no space before the return type
891 lines =<< trim END
892 var Ref = (x):number => x + 1
893 END
894 CheckDefAndScriptFailure(lines, 'E1069:', 1)
889 895
890 # this works 896 # this works
891 for x in ['foo', 'boo'] 897 for x in ['foo', 'boo']
892 echo FilterWithCond(x, (v) => v =~ '^b') 898 echo FilterWithCond(x, (v) => v =~ '^b')
893 endfor 899 endfor
1316 vim9script 1322 vim9script
1317 def Func(a: number , b: number) 1323 def Func(a: number , b: number)
1318 enddef 1324 enddef
1319 END 1325 END
1320 CheckScriptFailure(lines, 'E1068:') 1326 CheckScriptFailure(lines, 'E1068:')
1327 call assert_fails('vim9cmd echo stridx("a" .. "b" , "a")', 'E1068:')
1321 enddef 1328 enddef
1322 1329
1323 def Test_white_space_after_comma() 1330 def Test_white_space_after_comma()
1324 var lines =<< trim END 1331 var lines =<< trim END
1325 vim9script 1332 vim9script