Patch 8.2.2102
Problem:    Vim9: not all error messages tested.
Solution:   Add a few test cases.
Files:      src/testdir/test_vim9_func.vim


*** ../vim-8.2.2101/src/testdir/test_vim9_func.vim      2020-12-05 
21:22:03.626811733 +0100
--- src/testdir/test_vim9_func.vim      2020-12-06 18:45:21.647135761 +0100
***************
*** 217,238 ****
    CheckDefFailure(['def s:Nested()', 'enddef'], 'E1075:')
    CheckDefFailure(['def b:Nested()', 'enddef'], 'E1075:')
  
!   CheckDefFailure([
!         'def Outer()',
!         '  def Inner()',
!         '    # comment',
!         '  enddef',
!         '  def Inner()',
!         '  enddef',
!         'enddef'], 'E1073:')
!   CheckDefFailure([
!         'def Outer()',
!         '  def Inner()',
!         '    # comment',
!         '  enddef',
!         '  def! Inner()',
!         '  enddef',
!         'enddef'], 'E1117:')
  enddef
  
  func Test_call_default_args_from_func()
--- 217,263 ----
    CheckDefFailure(['def s:Nested()', 'enddef'], 'E1075:')
    CheckDefFailure(['def b:Nested()', 'enddef'], 'E1075:')
  
!   var lines =<< trim END
!       def Outer()
!         def Inner()
!           # comment
!         enddef
!         def Inner()
!         enddef
!       enddef
!   END
!   CheckDefFailure(lines, 'E1073:')
! 
!   lines =<< trim END
!       def Outer()
!         def Inner()
!           # comment
!         enddef
!         def! Inner()
!         enddef
!       enddef
!   END
!   CheckDefFailure(lines, 'E1117:')
! 
!   # nested function inside conditional
!   # TODO: should it work when "thecount" is inside the "if"?
!   lines =<< trim END
!       vim9script
!       var thecount = 0
!       if true
!         def Test(): number
!           def TheFunc(): number
!             thecount += 1
!             return thecount
!           enddef
!           return TheFunc()
!         enddef
!       endif
!       defcompile
!       assert_equal(1, Test())
!       assert_equal(2, Test())
!   END
!   CheckScriptSuccess(lines)
  enddef
  
  func Test_call_default_args_from_func()
***************
*** 315,320 ****
--- 340,354 ----
    assert_true(funcs->index('def DefListAll()') >= 0)
    assert_true(funcs->index('def DefListOne()') >= 0)
    assert_true(funcs->index('def DefListMatches()') >= 0)
+ 
+   var lines =<< trim END
+     vim9script
+     def Func()
+       def +Func+
+     enddef
+     defcompile
+   END
+   CheckScriptFailure(lines, 'E476:', 1)
  enddef
  
  def Test_global_local_function()
*** ../vim-8.2.2101/src/version.c       2020-12-06 16:03:51.605729875 +0100
--- src/version.c       2020-12-06 18:46:26.946949328 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2102,
  /**/

-- 
LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
ARTHUR:    No, that's Saint Ives.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202012061751.0B6HpBoP1140019%40masaka.moolenaar.net.

Raspunde prin e-mail lui