# HG changeset patch # User Bram Moolenaar # Date 1675526404 -3600 # Node ID ecfabcaafc0b31db0ffed7f3704869adb9376a64 # Parent bb5c63d6020cdd2a2399a4817171db371b80174f patch 9.0.1280: inssufficient testing for what 9.0.1265 fixes Commit: https://github.com/vim/vim/commit/7a1bdaecf2d2a06eb06ed462e6ccae4954939fc9 Author: Bram Moolenaar Date: Sat Feb 4 15:45:27 2023 +0000 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 https://github.com/vim/vim/issues/11885) diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1280, +/**/ 1279, /**/ 1278,