Patch 9.0.1280
Problem: Inssufficient testing for what 9.0.1265 fixes.
Solution: Add a couple of test cases. (issue #11885)
Files: src/testdir/test_vim9_class.vim
*** ../vim-9.0.1279/src/testdir/test_vim9_class.vim 2023-01-30
20:24:19.687565537 +0000
--- src/testdir/test_vim9_class.vim 2023-02-04 15:41:19.715180756 +0000
***************
*** 1050,1055 ****
--- 1050,1109 ----
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
*** ../vim-9.0.1279/src/version.c 2023-02-04 13:57:27.608749797 +0000
--- src/version.c 2023-02-04 15:44:00.843097232 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1280,
/**/
--
>From "know your smileys":
8-O "Omigod!!" (done "rm -rf *" ?)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230204154602.DBA621C0A8B%40moolenaar.net.