forked from aniani/vim
patch 9.1.1245: need some more tests for curly braces evaluation
Problem: need some more tests for curly braces evaluation Solution: Add a test for the regression introduced by patch v9.1.1242 (Yegappan Lakshmanan) closes: #16986 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
35cb38d34b
commit
d9b82cfe84
@@ -93,6 +93,26 @@ func Test_let()
|
||||
let [l[0], l[1]] = [10, 20]
|
||||
call assert_equal([10, 20, 3], l)
|
||||
|
||||
" Test for using curly brace name in the LHS of an assignment
|
||||
let listvar = [1, 2]
|
||||
let s = 'listvar'
|
||||
let {s} = [3, 4]
|
||||
call assert_equal([3, 4], listvar)
|
||||
|
||||
" Test for using curly brace name as a list and as list index in the LHS of
|
||||
" an assignment
|
||||
let listvar = [1, 2]
|
||||
let idx = 1
|
||||
let s = 'listvar'
|
||||
let {s}[0] = 10
|
||||
let s = 'idx'
|
||||
let listvar[{s}] = 20
|
||||
call assert_equal([10, 20], listvar)
|
||||
let s1 = 'listvar'
|
||||
let s2 = 'idx'
|
||||
let {s1}[{s2}] = 30
|
||||
call assert_equal([10, 30], listvar)
|
||||
|
||||
" Test for errors in conditional expression
|
||||
call assert_fails('let val = [] ? 1 : 2', 'E745:')
|
||||
call assert_fails('let val = 1 ? 5+ : 6', 'E121:')
|
||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1245,
|
||||
/**/
|
||||
1244,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user