forked from aniani/vim
patch 9.1.0415: Some functions are not tested
Problem: Some functions are not tested
Solution: Add a few more tests, fix a few minor problems
(Yegappan Lakshmanan)
closes: #14789
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
e595e9c31b
commit
fe424d13ef
@@ -2512,6 +2512,13 @@ def Test_for_loop()
|
||||
assert_equal(['x', 'x', 'x'], reslist)
|
||||
END
|
||||
v9.CheckDefAndScriptSuccess(lines)
|
||||
|
||||
lines =<< trim END
|
||||
for i : number : [1, 2]
|
||||
echo i
|
||||
endfor
|
||||
END
|
||||
v9.CheckSourceDefAndScriptFailure(lines, 'E1059: No white space allowed before colon: : [1, 2]', 1)
|
||||
enddef
|
||||
|
||||
def Test_for_loop_list_of_lists()
|
||||
@@ -5096,6 +5103,13 @@ def Test_unknown_type_in_typecast()
|
||||
var Fn = <funcx(number, number): number>b
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1010: Type not recognized: funcx(number, number): number', 2)
|
||||
|
||||
# Wrong type in a type cast
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
var i: number = <number>true
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1012: Type mismatch; expected number but got bool', 2)
|
||||
enddef
|
||||
|
||||
" Keep this last, it messes up highlighting.
|
||||
|
||||
Reference in New Issue
Block a user