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

patch 8.2.4395: some code lines not covered by tests

Problem:    Some code lines not covered by tests.
Solution:   Add a few more test cases.  Fix getting more than one error for
            invalid assignment.
This commit is contained in:
Bram Moolenaar
2022-02-15 21:17:56 +00:00
parent 9fdde7992a
commit 8b716f5f22
7 changed files with 38 additions and 5 deletions

View File

@@ -1354,6 +1354,13 @@ def Test_command_not_recognized()
END
v9.CheckDefFailure(lines, 'E1146:', 1)
lines =<< trim END
if 0
d.key = 'asdf'
endif
END
v9.CheckDefSuccess(lines)
lines =<< trim END
d['key'] = 'asdf'
END
@@ -1621,6 +1628,11 @@ def Test_substitute_expr()
s/text/\=['aaa', 'bbb', 'ccc']/
assert_equal(['some aaa', 'bbb', 'ccc', ' here'], getline(1, '$'))
bwipe!
# inside "if 0" substitute is ignored
if 0
s/a/\=nothing/ and | some more
endif
enddef
def Test_redir_to_var()
@@ -1663,6 +1675,12 @@ def Test_redir_to_var()
END
v9.CheckDefFailure(lines, 'E1089:')
lines =<< trim END
var text: string
redir => text
END
v9.CheckDefFailure(lines, 'E1185:')
lines =<< trim END
var ls = 'asdf'
redir => ls[1]