Skip to content

Commit 083966f

Browse files
committed
patch 8.2.2108: Vim9: no test to check for :let error
Problem: Vim9: no test to check for :let error. Solution: Add a test. Rename tests from _let_ to _var_.
1 parent 8ff16e0 commit 083966f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/testdir/test_vim9_assign.vim

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ def Test_heredoc()
995995
delfunc! g:Func
996996
enddef
997997

998-
def Test_let_func_call()
998+
def Test_var_func_call()
999999
var lines =<< trim END
10001000
vim9script
10011001
func GetValue()
@@ -1019,7 +1019,7 @@ def Test_let_func_call()
10191019
delete('Xfinished')
10201020
enddef
10211021

1022-
def Test_let_missing_type()
1022+
def Test_var_missing_type()
10231023
var lines =<< trim END
10241024
vim9script
10251025
var name = g:unknown
@@ -1034,7 +1034,7 @@ def Test_let_missing_type()
10341034
CheckScriptSuccess(lines)
10351035
enddef
10361036

1037-
def Test_let_declaration()
1037+
def Test_var_declaration()
10381038
var lines =<< trim END
10391039
vim9script
10401040
var name: string
@@ -1069,7 +1069,7 @@ def Test_let_declaration()
10691069
unlet g:other_var
10701070
enddef
10711071

1072-
def Test_let_declaration_fails()
1072+
def Test_var_declaration_fails()
10731073
var lines =<< trim END
10741074
vim9script
10751075
final var: string
@@ -1089,7 +1089,7 @@ def Test_let_declaration_fails()
10891089
CheckScriptFailure(lines, 'E475:')
10901090
enddef
10911091

1092-
def Test_let_type_check()
1092+
def Test_var_type_check()
10931093
var lines =<< trim END
10941094
vim9script
10951095
var name: string
@@ -1126,7 +1126,7 @@ enddef
11261126

11271127
let g:dict_number = #{one: 1, two: 2}
11281128

1129-
def Test_let_list_dict_type()
1129+
def Test_var_list_dict_type()
11301130
var ll: list<number>
11311131
ll = [1, 2, 2, 3, 3, 3]->uniq()
11321132
ll->assert_equal([1, 2, 3])
@@ -1142,6 +1142,10 @@ def Test_let_list_dict_type()
11421142
CheckDefExecFailure(lines, 'E1012: Type mismatch; expected list<number> but got list<string>')
11431143
enddef
11441144

1145+
def Test_cannot_use_let()
1146+
CheckDefAndScriptFailure(['let a = 34'], 'E1126:', 1)
1147+
enddef
1148+
11451149
def Test_unlet()
11461150
g:somevar = 'yes'
11471151
assert_true(exists('g:somevar'))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2108,
753755
/**/
754756
2107,
755757
/**/

0 commit comments

Comments
 (0)