forked from aniani/vim
patch 8.1.1921: more functions can be used as methods
Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
This commit is contained in:
@@ -403,7 +403,7 @@ function Test_printf_spec_s()
|
||||
call assert_equal(string(value), printf('%s', value))
|
||||
|
||||
" funcref
|
||||
call assert_equal('printf', printf('%s', function('printf')))
|
||||
call assert_equal('printf', printf('%s', 'printf'->function()))
|
||||
|
||||
" partial
|
||||
call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s'])))
|
||||
@@ -490,7 +490,7 @@ func Test_funcref()
|
||||
endfunc
|
||||
call assert_equal(2, OneByName())
|
||||
call assert_equal(1, OneByRef())
|
||||
let OneByRef = funcref('One')
|
||||
let OneByRef = 'One'->funcref()
|
||||
call assert_equal(2, OneByRef())
|
||||
call assert_fails('echo funcref("{")', 'E475:')
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user