0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 8.2.4410: Vim9: some code not covered by tests

Problem:    Vim9: some code not covered by tests.
Solution:   Add a few more tests. Remove dead code.
This commit is contained in:
Bram Moolenaar
2022-02-17 19:44:07 +00:00
parent 6296d1e60e
commit 0c7f2610de
6 changed files with 55 additions and 32 deletions

View File

@@ -1551,6 +1551,28 @@ def Test_lockvar()
END
v9.CheckScriptFailure(lines, 'E1119', 4)
lines =<< trim END
vim9script
var theList = [1, 2, 3]
def AddToList()
lockvar theList
theList += [4]
enddef
AddToList()
END
v9.CheckScriptFailure(lines, 'E741', 2)
lines =<< trim END
vim9script
var theList = [1, 2, 3]
def AddToList()
lockvar theList
add(theList, 4)
enddef
AddToList()
END
v9.CheckScriptFailure(lines, 'E741', 2)
lines =<< trim END
var theList = [1, 2, 3]
lockvar theList