From 88da85a3cd88838a7779ad27c533e62f890e7b18 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 29 Feb 2016 13:48:59 +0100 Subject: Tests: fix according to lualint --- test/functional/terminal/edit_spec.lua | 3 +-- test/functional/ui/screen.lua | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 3ad1b33970..6da1521121 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -26,7 +26,7 @@ describe(':edit term://*', function() meths.set_var('termopen_runs', {}) command('autocmd TermOpen * :call add(g:termopen_runs, expand(""))') command('edit term://') - termopen_runs = meths.get_var('termopen_runs') + local termopen_runs = meths.get_var('termopen_runs') eq(1, #termopen_runs) eq(termopen_runs[1], termopen_runs[1]:match('^term://.//%d+:$')) end) @@ -59,7 +59,6 @@ describe(':edit term://*', function() -- contents: buffer starts with 87:, screen with 86:. local exp_screen = '\n' local did_cursor = false - local shift = 10 for i = 0,(winheight - 1) do local line = bufline(buf_cont_start + i - 1) exp_screen = (exp_screen diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 3f857e25f9..b35e0cde69 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -226,15 +226,16 @@ function Screen:expect(expected, attr_ids, attr_ignore) 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 + for j = 1, #expected_rows do + msg_expected_rows[j] = expected_rows[j] + end msg_expected_rows[i] = '*' .. msg_expected_rows[i] actual_rows[i] = '*' .. actual_rows[i] - msg = ( + return ( '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) -- cgit