mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.0764: Vim9: assigning to option not fully tested
Problem: Vim9: assigning to option not fully tested. Solution: Add more test cases. Allow using any type for assignment.
This commit is contained in:
@@ -14,6 +14,8 @@ let s:addToMe = 111
|
||||
let g:existing = 'yes'
|
||||
let g:inc_counter = 1
|
||||
let $SOME_ENV_VAR = 'some'
|
||||
let g:alist = [7]
|
||||
let g:astring = 'text'
|
||||
|
||||
def Test_assignment()
|
||||
let bool1: bool = true
|
||||
@@ -95,7 +97,12 @@ def Test_assignment()
|
||||
assert_equal(2, &ts)
|
||||
call CheckDefFailure(['¬ex += 3'], 'E113:')
|
||||
call CheckDefFailure(['&ts ..= "xxx"'], 'E1019:')
|
||||
call CheckDefFailure(['&ts = [7]'], 'E1013:')
|
||||
call CheckDefExecFailure(['&ts = g:alist'], 'E1029: Expected number but got list')
|
||||
call CheckDefFailure(['&ts = "xx"'], 'E1013:')
|
||||
call CheckDefExecFailure(['&ts = g:astring'], 'E1029: Expected number but got string')
|
||||
call CheckDefFailure(['&path += 3'], 'E1013:')
|
||||
call CheckDefExecFailure(['&bs = "asdf"'], 'E474:')
|
||||
# test freeing ISN_STOREOPT
|
||||
call CheckDefFailure(['&ts = 3', 'let asdf'], 'E1022:')
|
||||
&ts = 8
|
||||
|
Reference in New Issue
Block a user