mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.0659: Vim9: no test for equal func type
Problem: Vim9: no test for equal func type. Solution: Add a test. Improve type check.
This commit is contained in:
@@ -30,6 +30,16 @@ def Test_expr1()
|
||||
assert_equal('two', {} ? 'one' : 'two')
|
||||
var = 0
|
||||
assert_equal('two', var ? 'one' : 'two')
|
||||
|
||||
let Some: func = function('len')
|
||||
let Other: func = function('winnr')
|
||||
let Res: func = g:atrue ? Some : Other
|
||||
assert_equal(function('len'), Res)
|
||||
|
||||
let RetOne: func(string): number = function('len')
|
||||
let RetTwo: func(string): number = function('winnr')
|
||||
let RetThat: func = g:atrue ? RetOne : RetTwo
|
||||
assert_equal(function('len'), RetThat)
|
||||
enddef
|
||||
|
||||
func Test_expr1_fails()
|
||||
|
Reference in New Issue
Block a user