0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1280: inssufficient testing for what 9.0.1265 fixes

Problem:    Inssufficient testing for what 9.0.1265 fixes.
Solution:   Add a couple of test cases. (issue #11885)
This commit is contained in:
Bram Moolenaar
2023-02-04 15:45:27 +00:00
parent 61fdbfa1e3
commit 7a1bdaecf2
2 changed files with 56 additions and 0 deletions

View File

@@ -1050,6 +1050,60 @@ def Test_call_interface_method()
END
v9.CheckScriptSuccess(lines)
# method of interface returns a value
lines =<< trim END
vim9script
interface Base
def Enter(): string
endinterface
class Child implements Base
def Enter(): string
g:result ..= 'child'
return "/resource"
enddef
endclass
def F(obj: Base)
var r = obj.Enter()
g:result ..= r
enddef
g:result = ''
F(Child.new())
assert_equal('child/resource', g:result)
unlet g:result
END
v9.CheckScriptSuccess(lines)
lines =<< trim END
vim9script
class Base
def Enter(): string
return null_string
enddef
endclass
class Child extends Base
def Enter(): string
g:result ..= 'child'
return "/resource"
enddef
endclass
def F(obj: Base)
var r = obj.Enter()
g:result ..= r
enddef
g:result = ''
F(Child.new())
assert_equal('child/resource', g:result)
unlet g:result
END
v9.CheckScriptSuccess(lines)
# No class that implements the interface.
lines =<< trim END
vim9script

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1280,
/**/
1279,
/**/