mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
test: lint whitespace in legacy/ (#7308)
This commit is contained in:
committed by
Justin M. Keyes
parent
2b4a52f901
commit
126b2ca077
@@ -17,4 +17,4 @@ ignore = {
|
||||
}
|
||||
|
||||
-- Ignore whitespace issues in converted Vim legacy tests.
|
||||
files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }}
|
||||
--files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }}
|
||||
|
||||
@@ -15,6 +15,8 @@ local function insert_(content)
|
||||
feed_command('1', 'set cin ts=4 sw=4')
|
||||
end
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
describe('cindent', function()
|
||||
before_each(clear)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ local wait = helpers.wait
|
||||
describe('test5', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
start of test file Xxx
|
||||
|
||||
@@ -94,6 +94,8 @@ describe('file reading, writing and bufnew and filter autocommands', function()
|
||||
eq(gzip_data, io.open('Xtestfile.gz'):read('*all'))
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
it('FileReadPre, FileReadPost', function()
|
||||
prepare_gz_file('Xtestfile', text1)
|
||||
feed_command('au! FileReadPre *.gz exe "silent !gzip -d " . shellescape(expand("<afile>"))')
|
||||
|
||||
@@ -9,6 +9,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
||||
describe('alignment', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
test for :left
|
||||
|
||||
@@ -8,6 +8,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
||||
describe([[performing "r<Tab>" with 'smarttab' and 'expandtab' set/not set, and "dv_"]], function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
start text
|
||||
|
||||
@@ -11,6 +11,8 @@ local feed_command = helpers.feed_command
|
||||
describe('joining lines', function()
|
||||
before_each(clear)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
it("keeps marks with different 'joinspaces' settings", function()
|
||||
insert([[
|
||||
firstline
|
||||
|
||||
@@ -9,6 +9,7 @@ local wait = helpers.wait
|
||||
describe('lisp indent', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
(defun html-file (base)
|
||||
|
||||
@@ -7,6 +7,7 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
||||
describe('Virtual replace mode', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
-- Make sure that backspace works, no matter what termcap is used.
|
||||
feed_command('set t_kD=x7f t_kb=x08')
|
||||
|
||||
@@ -43,6 +43,7 @@ describe('Visual block mode', function()
|
||||
abcdqqqqijklm]])
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
it('should insert a block using cursor keys for movement', function()
|
||||
insert([[
|
||||
aaaaaa
|
||||
@@ -104,6 +105,7 @@ describe('Visual block mode', function()
|
||||
456ab7]])
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('should insert and append a block when virtualedit=all', function()
|
||||
insert([[
|
||||
line1
|
||||
|
||||
@@ -191,6 +191,7 @@ describe('list and dictionary types', function()
|
||||
[3]]=])
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it('assignment to a list', function()
|
||||
source([[
|
||||
let l = [0, 1, 2, 3]
|
||||
|
||||
@@ -9,6 +9,7 @@ local expect = helpers.expect
|
||||
describe('text formatting', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it('is working', function()
|
||||
-- The control character <C-A> (byte \x01) needs to be put in the buffer
|
||||
-- directly. But the insert function sends the text to nvim in insert
|
||||
|
||||
@@ -7,6 +7,7 @@ local feed_command, expect = helpers.feed_command, helpers.expect
|
||||
describe('coptions', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
aaa two three four
|
||||
|
||||
@@ -7,6 +7,7 @@ local clear, expect = helpers.clear, helpers.expect
|
||||
describe('curswant', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
start target options
|
||||
|
||||
@@ -12,6 +12,7 @@ end
|
||||
describe('cursor and column position with conceal and tabulators', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('are working', function()
|
||||
insert([[
|
||||
start:
|
||||
|
||||
@@ -15,6 +15,7 @@ describe('store cursor position in session file in UTF-8', function()
|
||||
os.remove('test.out')
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
start:
|
||||
|
||||
@@ -17,6 +17,7 @@ describe('store cursor position in session file in Latin-1', function()
|
||||
os.remove('test.out')
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
start:
|
||||
|
||||
@@ -372,6 +372,7 @@ describe('Visual mode and operator', function()
|
||||
end)
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it('gv in exclusive select mode after operation', function()
|
||||
source([[
|
||||
$put ='zzz '
|
||||
|
||||
@@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
||||
describe('breakindent', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
it('is working', function()
|
||||
insert('dummy text')
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
||||
local clear, source, expect = helpers.clear, helpers.source, helpers.expect
|
||||
local feed_command = helpers.feed_command
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
describe('command_count', function()
|
||||
it('is working', function()
|
||||
-- It is relevant for the test to load a file initially. If this is
|
||||
|
||||
@@ -6,6 +6,7 @@ local clear, feed, expect = helpers.clear, helpers.feed, helpers.expect
|
||||
describe('CTRL-W in Insert mode', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
it('works for multi-byte characters', function()
|
||||
|
||||
for i = 1, 6 do
|
||||
|
||||
@@ -4,12 +4,14 @@ local helpers = require('test.functional.helpers')(after_each)
|
||||
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
|
||||
local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers.expect
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
describe("'listchars'", function()
|
||||
before_each(function()
|
||||
clear()
|
||||
feed_command('set listchars&vi')
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it("works with 'list'", function()
|
||||
source([[
|
||||
function GetScreenCharsForLine(lnum)
|
||||
|
||||
@@ -7,6 +7,9 @@ local clear, feed_command, expect = helpers.clear, helpers.feed_command, helpers
|
||||
describe('listlbr', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
-- luacheck: ignore 611 (Line contains only whitespaces)
|
||||
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||
it('is working', function()
|
||||
insert([[
|
||||
dummy text]])
|
||||
@@ -20,20 +23,20 @@ describe('listlbr', function()
|
||||
feed_command('set ts=4 sw=4 sts=4 linebreak sbr=+ wrap')
|
||||
source([[
|
||||
fu! ScreenChar(width)
|
||||
let c=''
|
||||
for j in range(1,4)
|
||||
for i in range(1,a:width)
|
||||
let c.=nr2char(screenchar(j, i))
|
||||
endfor
|
||||
let c.="\n"
|
||||
endfor
|
||||
return c
|
||||
let c=''
|
||||
for j in range(1,4)
|
||||
for i in range(1,a:width)
|
||||
let c.=nr2char(screenchar(j, i))
|
||||
endfor
|
||||
let c.="\n"
|
||||
endfor
|
||||
return c
|
||||
endfu
|
||||
fu! DoRecordScreen()
|
||||
wincmd l
|
||||
$put =printf(\"\n%s\", g:test)
|
||||
$put =g:line
|
||||
wincmd p
|
||||
wincmd l
|
||||
$put =printf(\"\n%s\", g:test)
|
||||
$put =g:line
|
||||
wincmd p
|
||||
endfu
|
||||
]])
|
||||
feed_command('let g:test="Test 1: set linebreak"')
|
||||
|
||||
@@ -8,6 +8,8 @@ local clear, expect = helpers.clear, helpers.expect
|
||||
describe('linebreak', function()
|
||||
setup(clear)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
-- luacheck: ignore 613 (Trailing whitespaces in a string)
|
||||
it('is working', function()
|
||||
source([[
|
||||
set wildchar=^E
|
||||
@@ -18,20 +20,20 @@ describe('linebreak', function()
|
||||
norm! zt
|
||||
set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
|
||||
fu! ScreenChar(width, lines)
|
||||
let c=''
|
||||
for j in range(1,a:lines)
|
||||
for i in range(1,a:width)
|
||||
let c.=nr2char(screenchar(j, i))
|
||||
endfor
|
||||
let c=''
|
||||
for j in range(1,a:lines)
|
||||
for i in range(1,a:width)
|
||||
let c.=nr2char(screenchar(j, i))
|
||||
endfor
|
||||
let c.="\n"
|
||||
endfor
|
||||
return c
|
||||
endfor
|
||||
return c
|
||||
endfu
|
||||
fu! DoRecordScreen()
|
||||
wincmd l
|
||||
$put =printf(\"\n%s\", g:test)
|
||||
$put =g:line
|
||||
wincmd p
|
||||
wincmd l
|
||||
$put =printf(\"\n%s\", g:test)
|
||||
$put =g:line
|
||||
wincmd p
|
||||
endfu
|
||||
"
|
||||
let g:test ="Test 1: set linebreak + set list + fancy listchars"
|
||||
|
||||
@@ -7,6 +7,7 @@ describe('marks', function()
|
||||
clear()
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 621 (Indentation)
|
||||
it('restores a deleted mark after delete-undo-redo-undo', function()
|
||||
insert([[
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ describe('utf8', function()
|
||||
eq(1, eval('strchars("\\u20dd", 1)'))
|
||||
end)
|
||||
|
||||
-- luacheck: ignore 613 (Trailing whitespace in a string)
|
||||
it('customlist completion', function()
|
||||
source([[
|
||||
function! CustomComplete1(lead, line, pos)
|
||||
|
||||
Reference in New Issue
Block a user