patch 8.2.4409: Vim9: some code not covered by tests
Problem: Vim9: some code not covered by tests.
Solution: Add a few more tests. Fix reported line number.
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index c5f56c2..1d62ac1 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -847,6 +847,9 @@
assert_equal(['sdf', 'asdf', 'end'], list3)
v9.CheckDefExecFailure(['var ll = [1, 2, 3]', 'll[-4] = 6'], 'E684:')
+ v9.CheckDefExecFailure(['var ll = [1, 2, 3]', 'unlet ll[8 : 9]'], 'E684:')
+ v9.CheckDefExecFailure(['var ll = [1, 2, 3]', 'unlet ll[1 : -9]'], 'E684:')
+ v9.CheckDefExecFailure(['var ll = [1, 2, 3]', 'unlet ll[2 : 1]'], 'E684:')
# type becomes list<any>
var somelist = rand() > 0 ? [1, 2, 3] : ['a', 'b', 'c']
@@ -2193,6 +2196,10 @@
'g:dd = {"a": 1, 2: 2}'
'unlet g:dd[0z11]',
], 'E1029:', 2)
+ v9.CheckDefExecFailure([
+ 'g:str = "a string"'
+ 'unlet g:str[0]',
+ ], 'E1148: Cannot index a string', 2)
# can compile unlet before variable exists
g:someDict = {key: 'val'}