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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user