~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to test/functional/ui/screen.lua

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20160418214219-6lf1w0zadujghas7
Tags: upstream-0.1.3
ImportĀ upstreamĀ versionĀ 0.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
  local ids = attr_ids or self._default_attr_ids
220
220
  local ignore = attr_ignore or self._default_attr_ignore
221
221
  self:wait(function()
222
 
    for i = 1, self._height do
223
 
      local expected_row = expected_rows[i]
224
 
      local actual_row = self:_row_repr(self._rows[i], ids, ignore)
225
 
      if expected_row ~= actual_row then
226
 
        return 'Row '..tostring(i)..' didn\'t match.\nExpected: "'..
227
 
               expected_row..'"\nActual:   "'..actual_row..'"'
 
222
    local actual_rows = {}
 
223
    for i = 1, self._height do
 
224
      actual_rows[i] = self:_row_repr(self._rows[i], ids, ignore)
 
225
    end
 
226
    for i = 1, self._height do
 
227
      if expected_rows[i] ~= actual_rows[i] then
 
228
        local msg_expected_rows = {}
 
229
        for j = 1, #expected_rows do
 
230
          msg_expected_rows[j] = expected_rows[j]
 
231
        end
 
232
        msg_expected_rows[i] = '*' .. msg_expected_rows[i]
 
233
        actual_rows[i] = '*' .. actual_rows[i]
 
234
        return (
 
235
          'Row ' .. tostring(i) .. ' didn\'t match.\n'
 
236
          .. 'Expected:\n|' .. table.concat(msg_expected_rows, '|\n|') .. '|\n'
 
237
          .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|'
 
238
        )
228
239
      end
229
240
    end
230
241
  end)