aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-28 11:46:04 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-28 11:46:04 -0500
commit8ade191b7ab6dec93b09259ac4a370ed5b29df3a (patch)
tree09afa1739493986c3b93a680075506d82aea368d /test/functional/ui/screen.lua
parent9d41060c32b472b69ba1619056ee99691a6ff1c4 (diff)
parent0409cfded5ca126a734e99657182cb4837f149c9 (diff)
downloadrneovim-8ade191b7ab6dec93b09259ac4a370ed5b29df3a.tar.gz
rneovim-8ade191b7ab6dec93b09259ac4a370ed5b29df3a.tar.bz2
rneovim-8ade191b7ab6dec93b09259ac4a370ed5b29df3a.zip
Merge pull request #4364 from ZyX-I/proper-e-term
Replace hack used to run TermOpen with nested modifier
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 80f46326ee..3f857e25f9 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -219,12 +219,22 @@ function Screen:expect(expected, attr_ids, attr_ignore)
local ids = attr_ids or self._default_attr_ids
local ignore = attr_ignore or self._default_attr_ignore
self:wait(function()
+ local actual_rows = {}
for i = 1, self._height do
- local expected_row = expected_rows[i]
- local actual_row = self:_row_repr(self._rows[i], ids, ignore)
- if expected_row ~= actual_row then
- return 'Row '..tostring(i)..' didn\'t match.\nExpected: "'..
- expected_row..'"\nActual: "'..actual_row..'"'
+ actual_rows[i] = self:_row_repr(self._rows[i], ids, ignore)
+ end
+ for i = 1, self._height do
+ if expected_rows[i] ~= actual_rows[i] then
+ local msg_expected_rows = {}
+ for i = 1, #expected_rows do msg_expected_rows[i] = expected_rows[i] end
+ msg_expected_rows[i] = '*' .. msg_expected_rows[i]
+ actual_rows[i] = '*' .. actual_rows[i]
+ msg = (
+ 'Row ' .. tostring(i) .. ' didn\'t match.\n'
+ .. 'Expected:\n|' .. table.concat(msg_expected_rows, '|\n|') .. '|\n'
+ .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|'
+ )
+ return msg
end
end
end)