Patch 8.2.2108
Problem:    Vim9: no test to check for :let error.
Solution:   Add a test.  Rename tests from _let_ to _var_.
Files:      src/testdir/test_vim9_assign.vim


*** ../vim-8.2.2107/src/testdir/test_vim9_assign.vim    2020-12-07 
21:49:48.416837683 +0100
--- src/testdir/test_vim9_assign.vim    2020-12-08 11:28:15.063555955 +0100
***************
*** 995,1001 ****
    delfunc! g:Func
  enddef
  
! def Test_let_func_call()
    var lines =<< trim END
      vim9script
      func GetValue()
--- 995,1001 ----
    delfunc! g:Func
  enddef
  
! def Test_var_func_call()
    var lines =<< trim END
      vim9script
      func GetValue()
***************
*** 1019,1025 ****
    delete('Xfinished')
  enddef
  
! def Test_let_missing_type()
    var lines =<< trim END
      vim9script
      var name = g:unknown
--- 1019,1025 ----
    delete('Xfinished')
  enddef
  
! def Test_var_missing_type()
    var lines =<< trim END
      vim9script
      var name = g:unknown
***************
*** 1034,1040 ****
    CheckScriptSuccess(lines)
  enddef
  
! def Test_let_declaration()
    var lines =<< trim END
      vim9script
      var name: string
--- 1034,1040 ----
    CheckScriptSuccess(lines)
  enddef
  
! def Test_var_declaration()
    var lines =<< trim END
      vim9script
      var name: string
***************
*** 1069,1075 ****
    unlet g:other_var
  enddef
  
! def Test_let_declaration_fails()
    var lines =<< trim END
      vim9script
      final var: string
--- 1069,1075 ----
    unlet g:other_var
  enddef
  
! def Test_var_declaration_fails()
    var lines =<< trim END
      vim9script
      final var: string
***************
*** 1089,1095 ****
    CheckScriptFailure(lines, 'E475:')
  enddef
  
! def Test_let_type_check()
    var lines =<< trim END
      vim9script
      var name: string
--- 1089,1095 ----
    CheckScriptFailure(lines, 'E475:')
  enddef
  
! def Test_var_type_check()
    var lines =<< trim END
      vim9script
      var name: string
***************
*** 1126,1132 ****
  
  let g:dict_number = #{one: 1, two: 2}
  
! def Test_let_list_dict_type()
    var ll: list<number>
    ll = [1, 2, 2, 3, 3, 3]->uniq()
    ll->assert_equal([1, 2, 3])
--- 1126,1132 ----
  
  let g:dict_number = #{one: 1, two: 2}
  
! def Test_var_list_dict_type()
    var ll: list<number>
    ll = [1, 2, 2, 3, 3, 3]->uniq()
    ll->assert_equal([1, 2, 3])
***************
*** 1142,1147 ****
--- 1142,1151 ----
    CheckDefExecFailure(lines, 'E1012: Type mismatch; expected list<number> but 
got list<string>')
  enddef
  
+ def Test_cannot_use_let()
+   CheckDefAndScriptFailure(['let a = 34'], 'E1126:', 1)
+ enddef
+ 
  def Test_unlet()
    g:somevar = 'yes'
    assert_true(exists('g:somevar'))
*** ../vim-8.2.2107/src/version.c       2020-12-07 21:49:48.416837683 +0100
--- src/version.c       2020-12-08 11:29:03.287374954 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2108,
  /**/

-- 
There is no right or wrong, there is only your personal opinion.
                 (Bram Moolenaar)

 /// 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/202012081030.0B8AUhL31597400%40masaka.moolenaar.net.

Raspunde prin e-mail lui