mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
test(screen): still match by full row when {MATCH:} is present (#34437)
Add '^' and '$' around the pattern. This makes it less likely to make
mistakes of when writing tests with {MATCH:}, as most such tests have
text before and after {MATCH:}.
This commit is contained in:
@@ -586,6 +586,7 @@ function Screen:expect(expected, attr_ids, ...)
|
||||
after = after:sub(e + 1)
|
||||
end
|
||||
end
|
||||
pat = pat and '^' .. pat .. '$'
|
||||
if row ~= actual_rows[i] and (not pat or not actual_rows[i]:match(pat)) then
|
||||
msg_expected_rows[i] = '*' .. msg_expected_rows[i]
|
||||
if i <= #actual_rows then
|
||||
|
||||
Reference in New Issue
Block a user