Patch 8.2.3181
Problem:    Vim9: builtin function test fails without channel feature.
Solution:   Add feature checks. (Dominique Pellé, closes #8586)  Make feature
            checks more consistent.
Files:      src/testdir/test_vim9_builtin.vim


*** ../vim-8.2.3180/src/testdir/test_vim9_builtin.vim   2021-07-17 
19:11:03.580709066 +0200
--- src/testdir/test_vim9_builtin.vim   2021-07-18 21:40:27.773143406 +0200
***************
*** 398,406 ****
  enddef
  
  def Test_ch_getjob()
!   CheckDefAndScriptFailure2(['ch_getjob(1)'], 'E1013: Argument 1: type 
mismatch, expected channel but got number', 'E475: Invalid argument:')
!   CheckDefAndScriptFailure2(['ch_getjob({"a": 10})'], 'E1013: Argument 1: 
type mismatch, expected channel but got dict<number>', 'E731: Using a 
Dictionary as a String')
!   assert_equal(0, ch_getjob(test_null_channel()))
  enddef
  
  def Test_ch_info()
--- 398,410 ----
  enddef
  
  def Test_ch_getjob()
!   if !has('channel')
!     CheckFeature channel
!   else
!     CheckDefAndScriptFailure2(['ch_getjob(1)'], 'E1013: Argument 1: type 
mismatch, expected channel but got number', 'E475: Invalid argument:')
!     CheckDefAndScriptFailure2(['ch_getjob({"a": 10})'], 'E1013: Argument 1: 
type mismatch, expected channel but got dict<number>', 'E731: Using a 
Dictionary as a String')
!     assert_equal(0, ch_getjob(test_null_channel()))
!   endif
  enddef
  
  def Test_ch_info()
***************
*** 1425,1441 ****
  enddef
  
  def Test_job_getchannel()
!   CheckDefAndScriptFailure2(['job_getchannel("a")'], 'E1013: Argument 1: type 
mismatch, expected job but got string', 'E475: Invalid argument')
!   assert_fails('job_getchannel(test_null_job())', 'E916: not a valid job')
  enddef
  
  def Test_job_info()
!   CheckDefAndScriptFailure2(['job_info("a")'], 'E1013: Argument 1: type 
mismatch, expected job but got string', 'E475: Invalid argument')
!   assert_fails('job_info(test_null_job())', 'E916: not a valid job')
  enddef
  
  def Test_job_info_return_type()
!   if has('job')
      job_start(&shell)
      var jobs = job_info()
      assert_equal('list<job>', typename(jobs))
--- 1429,1455 ----
  enddef
  
  def Test_job_getchannel()
!   if !has('job')
!     CheckFeature job
!   else
!     CheckDefAndScriptFailure2(['job_getchannel("a")'], 'E1013: Argument 1: 
type mismatch, expected job but got string', 'E475: Invalid argument')
!     assert_fails('job_getchannel(test_null_job())', 'E916: not a valid job')
!   endif
  enddef
  
  def Test_job_info()
!   if !has('job')
!     CheckFeature job
!   else
!     CheckDefAndScriptFailure2(['job_info("a")'], 'E1013: Argument 1: type 
mismatch, expected job but got string', 'E475: Invalid argument')
!     assert_fails('job_info(test_null_job())', 'E916: not a valid job')
!   endif
  enddef
  
  def Test_job_info_return_type()
!   if !has('job')
!     CheckFeature job
!   else
      job_start(&shell)
      var jobs = job_info()
      assert_equal('list<job>', typename(jobs))
***************
*** 1445,1452 ****
  enddef
  
  def Test_job_status()
!   CheckDefAndScriptFailure2(['job_status("a")'], 'E1013: Argument 1: type 
mismatch, expected job but got string', 'E475: Invalid argument')
!   assert_equal('fail', job_status(test_null_job()))
  enddef
  
  def Test_js_decode()
--- 1459,1470 ----
  enddef
  
  def Test_job_status()
!   if !has('job')
!     CheckFeature job
!   else
!     CheckDefAndScriptFailure2(['job_status("a")'], 'E1013: Argument 1: type 
mismatch, expected job but got string', 'E475: Invalid argument')
!     assert_equal('fail', job_status(test_null_job()))
!   endif
  enddef
  
  def Test_js_decode()
***************
*** 1877,1883 ****
  enddef
  
  def Test_prompt_getprompt()
!   if has('channel')
      CheckDefFailure(['prompt_getprompt([])'], 'E1013: Argument 1: type 
mismatch, expected string but got list<unknown>')
      assert_equal('', prompt_getprompt('NonExistingBuf'))
    endif
--- 1895,1903 ----
  enddef
  
  def Test_prompt_getprompt()
!   if !has('channel')
!     CheckFeature channel
!   else
      CheckDefFailure(['prompt_getprompt([])'], 'E1013: Argument 1: type 
mismatch, expected string but got list<unknown>')
      assert_equal('', prompt_getprompt('NonExistingBuf'))
    endif
***************
*** 2439,2445 ****
  
  def Test_spellsuggest()
    if !has('spell')
!     MissingFeature 'spell'
    else
      spellsuggest('marrch', 1, true)->assert_equal(['March'])
    endif
--- 2459,2465 ----
  
  def Test_spellsuggest()
    if !has('spell')
!     CheckFeature spell
    else
      spellsuggest('marrch', 1, true)->assert_equal(['March'])
    endif
***************
*** 2496,2502 ****
  
  def Run_str2float()
    if !has('float')
!     MissingFeature 'float'
    endif
      str2float("1.00")->assert_equal(1.00)
      str2float("2e-2")->assert_equal(0.02)
--- 2516,2522 ----
  
  def Run_str2float()
    if !has('float')
!     CheckFeature float
    endif
      str2float("1.00")->assert_equal(1.00)
      str2float("2e-2")->assert_equal(0.02)
***************
*** 2721,2727 ****
  
  def Test_term_gettty()
    if !has('terminal')
!     MissingFeature 'terminal'
    else
      var buf = Run_shell_in_terminal({})
      term_gettty(buf, true)->assert_notequal('')
--- 2741,2747 ----
  
  def Test_term_gettty()
    if !has('terminal')
!     CheckFeature terminal
    else
      var buf = Run_shell_in_terminal({})
      term_gettty(buf, true)->assert_notequal('')
***************
*** 2754,2760 ****
  enddef
  def Test_term_start()
    if !has('terminal')
!     MissingFeature 'terminal'
    else
      botright new
      var winnr = winnr()
--- 2774,2780 ----
  enddef
  def Test_term_start()
    if !has('terminal')
!     CheckFeature terminal
    else
      botright new
      var winnr = winnr()
*** ../vim-8.2.3180/src/version.c       2021-07-18 21:24:46.866637807 +0200
--- src/version.c       2021-07-18 21:41:54.809007818 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3181,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
176. You lie, even to user-friends, about how long you were online yesterday.

 /// 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/202107181945.16IJjBqt2829072%40masaka.moolenaar.net.

Raspunde prin e-mail lui