mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
build: Target luacheck HEAD.
https://github.com/mpeterv/luacheck/pull/81#issuecomment-261099606 > If you really want to use bleeding-edge version you should get the > rockspec from master branch, not a fixed commit ... > The correct way to install from a specific commit is cloning that > commit and running "luarocks make" from project directory. The reason > is that running "install" or "build" on an scm rockspec fetches > sources from master but uses build description from the rockspec > itself, which may be outdated.
This commit is contained in:
parent
5e241b5f50
commit
44e6ee930f
@ -11,3 +11,6 @@ self = false
|
|||||||
|
|
||||||
-- Rerun tests only if their modification time changed.
|
-- Rerun tests only if their modification time changed.
|
||||||
cache = true
|
cache = true
|
||||||
|
|
||||||
|
-- Ignore whitespace issues in converted Vim legacy tests.
|
||||||
|
files["functional/legacy"] = {ignore = { "611", "612", "613", "621" }}
|
||||||
|
@ -15,12 +15,12 @@ local measure_cmd =
|
|||||||
local measure_script = [[
|
local measure_script = [[
|
||||||
func! Measure(re, file, pattern, arg)
|
func! Measure(re, file, pattern, arg)
|
||||||
let sstart=reltime()
|
let sstart=reltime()
|
||||||
|
|
||||||
execute 'set re=' . a:re
|
execute 'set re=' . a:re
|
||||||
execute 'split' a:arg a:file
|
execute 'split' a:arg a:file
|
||||||
call search(a:pattern, '', '', 10000)
|
call search(a:pattern, '', '', 10000)
|
||||||
q!
|
q!
|
||||||
|
|
||||||
$put =printf('file: %s, re: %d, time: %s', a:file, a:re, reltimestr(reltime(sstart)))
|
$put =printf('file: %s, re: %d, time: %s', a:file, a:re, reltimestr(reltime(sstart)))
|
||||||
endfunc]]
|
endfunc]]
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ describe('TabClosed', function()
|
|||||||
it('matches when closing any tab', function()
|
it('matches when closing any tab', function()
|
||||||
clear()
|
clear()
|
||||||
nvim('command', 'au! TabClosed * echom "tabclosed:".expand("<afile>").":".expand("<amatch>").":".tabpagenr()')
|
nvim('command', 'au! TabClosed * echom "tabclosed:".expand("<afile>").":".expand("<amatch>").":".tabpagenr()')
|
||||||
repeat
|
repeat
|
||||||
nvim('command', 'tabnew')
|
nvim('command', 'tabnew')
|
||||||
until nvim('eval', 'tabpagenr()') == 6 -- current tab is now 6
|
until nvim('eval', 'tabpagenr()') == 6 -- current tab is now 6
|
||||||
eq("\ntabclosed:6:6:5", nvim('command_output', 'tabclose')) -- close last 6, current tab is now 5
|
eq("\ntabclosed:6:6:5", nvim('command_output', 'tabclose')) -- close last 6, current tab is now 5
|
||||||
@ -19,7 +19,7 @@ describe('TabClosed', function()
|
|||||||
describe('with NR as <afile>', function()
|
describe('with NR as <afile>', function()
|
||||||
it('matches when closing a tab whose index is NR', function()
|
it('matches when closing a tab whose index is NR', function()
|
||||||
nvim('command', 'au! TabClosed 2 echom "tabclosed:match"')
|
nvim('command', 'au! TabClosed 2 echom "tabclosed:match"')
|
||||||
repeat
|
repeat
|
||||||
nvim('command', 'tabnew')
|
nvim('command', 'tabnew')
|
||||||
until nvim('eval', 'tabpagenr()') == 5 -- current tab is now 5
|
until nvim('eval', 'tabpagenr()') == 5 -- current tab is now 5
|
||||||
-- sanity check, we shouldn't match on tabs with numbers other than 2
|
-- sanity check, we shouldn't match on tabs with numbers other than 2
|
||||||
|
@ -16,18 +16,18 @@ describe('msgpack*() functions', function()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Regression test: msgpack_list_write was failing to write buffer with zero
|
-- Regression test: msgpack_list_write was failing to write buffer with zero
|
||||||
-- length.
|
-- length.
|
||||||
obj_test('are able to dump and restore {"file": ""}', {{file=''}})
|
obj_test('are able to dump and restore {"file": ""}', {{file=''}})
|
||||||
-- Regression test: msgpack_list_write was failing to write buffer with NL at
|
-- Regression test: msgpack_list_write was failing to write buffer with NL at
|
||||||
-- the end.
|
-- the end.
|
||||||
obj_test('are able to dump and restore {0, "echo mpack"}', {{0, 'echo mpack'}})
|
obj_test('are able to dump and restore {0, "echo mpack"}', {{0, 'echo mpack'}})
|
||||||
obj_test('are able to dump and restore "Test\\n"', {'Test\n'})
|
obj_test('are able to dump and restore "Test\\n"', {'Test\n'})
|
||||||
-- Regression test: msgpack_list_write was failing to write buffer with NL
|
-- Regression test: msgpack_list_write was failing to write buffer with NL
|
||||||
-- inside.
|
-- inside.
|
||||||
obj_test('are able to dump and restore "Test\\nTest 2"', {'Test\nTest 2'})
|
obj_test('are able to dump and restore "Test\\nTest 2"', {'Test\nTest 2'})
|
||||||
-- Test that big objects (requirement: dump to something that is bigger then
|
-- Test that big objects (requirement: dump to something that is bigger then
|
||||||
-- IOSIZE) are also fine. This particular object is obtained by concatenating
|
-- IOSIZE) are also fine. This particular object is obtained by concatenating
|
||||||
-- 5 identical shada files.
|
-- 5 identical shada files.
|
||||||
local big_obj = {
|
local big_obj = {
|
||||||
1, 1436711454, 78, {
|
1, 1436711454, 78, {
|
||||||
|
@ -22,8 +22,8 @@ local cmdtest = function(cmd, prep, ret1)
|
|||||||
command(cmd .. '\nabc\ndef\n')
|
command(cmd .. '\nabc\ndef\n')
|
||||||
eq(ret1, buffer_contents())
|
eq(ret1, buffer_contents())
|
||||||
end)
|
end)
|
||||||
-- Used to crash because this invokes history processing which uses
|
-- Used to crash because this invokes history processing which uses
|
||||||
-- hist_char2type which after fdb68e35e4c729c7ed097d8ade1da29e5b3f4b31
|
-- hist_char2type which after fdb68e35e4c729c7ed097d8ade1da29e5b3f4b31
|
||||||
-- crashed.
|
-- crashed.
|
||||||
it(cmd .. 's' .. prep .. ' the current line by default when feeding',
|
it(cmd .. 's' .. prep .. ' the current line by default when feeding',
|
||||||
function()
|
function()
|
||||||
|
@ -4,7 +4,7 @@ local ok = helpers.ok
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
|
|
||||||
describe(":argument", function()
|
describe(":argument", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ local ok = helpers.ok
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
|
|
||||||
describe(":edit", function()
|
describe(":edit", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ describe(':browse oldfiles', function()
|
|||||||
|
|
||||||
-- Ensure nvim is out of "Press ENTER..." screen
|
-- Ensure nvim is out of "Press ENTER..." screen
|
||||||
feed('<cr>')
|
feed('<cr>')
|
||||||
|
|
||||||
-- Ensure v:oldfiles isn't busted. Since things happen so fast,
|
-- Ensure v:oldfiles isn't busted. Since things happen so fast,
|
||||||
-- the ordering of v:oldfiles is unstable (it uses qsort() under-the-hood).
|
-- the ordering of v:oldfiles is unstable (it uses qsort() under-the-hood).
|
||||||
-- Let's verify the contents and the length of v:oldfiles before moving on.
|
-- Let's verify the contents and the length of v:oldfiles before moving on.
|
||||||
|
@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
|
|
||||||
describe(':qa', function()
|
describe(':qa', function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear('--cmd', 'qa')
|
clear('--cmd', 'qa')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ describe(':preserve', function()
|
|||||||
|
|
||||||
it("saves to custom 'directory' and (R)ecovers (issue #1836)", function()
|
it("saves to custom 'directory' and (R)ecovers (issue #1836)", function()
|
||||||
local testfile = 'testfile_recover_spec'
|
local testfile = 'testfile_recover_spec'
|
||||||
-- Note: `set swapfile` *must* go after `set directory`: otherwise it may
|
-- Note: `set swapfile` *must* go after `set directory`: otherwise it may
|
||||||
-- attempt to create a swapfile in different directory.
|
-- attempt to create a swapfile in different directory.
|
||||||
local init = [[
|
local init = [[
|
||||||
set directory^=]]..swapdir..[[//
|
set directory^=]]..swapdir..[[//
|
||||||
|
@ -6,7 +6,7 @@ describe('history support code', function()
|
|||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
it('correctly clears start of the history', function()
|
it('correctly clears start of the history', function()
|
||||||
-- Regression test: check absense of the memory leak when clearing start of
|
-- Regression test: check absense of the memory leak when clearing start of
|
||||||
-- the history using ex_getln.c/clr_history().
|
-- the history using ex_getln.c/clr_history().
|
||||||
eq(1, funcs.histadd(':', 'foo'))
|
eq(1, funcs.histadd(':', 'foo'))
|
||||||
eq(1, funcs.histdel(':'))
|
eq(1, funcs.histdel(':'))
|
||||||
@ -14,7 +14,7 @@ describe('history support code', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('correctly clears end of the history', function()
|
it('correctly clears end of the history', function()
|
||||||
-- Regression test: check absense of the memory leak when clearing end of
|
-- Regression test: check absense of the memory leak when clearing end of
|
||||||
-- the history using ex_getln.c/clr_history().
|
-- the history using ex_getln.c/clr_history().
|
||||||
meths.set_option('history', 1)
|
meths.set_option('history', 1)
|
||||||
eq(1, funcs.histadd(':', 'foo'))
|
eq(1, funcs.histadd(':', 'foo'))
|
||||||
@ -23,8 +23,8 @@ describe('history support code', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('correctly removes item from history', function()
|
it('correctly removes item from history', function()
|
||||||
-- Regression test: check that ex_getln.c/del_history_idx() correctly clears
|
-- Regression test: check that ex_getln.c/del_history_idx() correctly clears
|
||||||
-- history index after removing history entry. If it does not then deleting
|
-- history index after removing history entry. If it does not then deleting
|
||||||
-- history will result in a double free.
|
-- history will result in a double free.
|
||||||
eq(1, funcs.histadd(':', 'foo'))
|
eq(1, funcs.histadd(':', 'foo'))
|
||||||
eq(1, funcs.histadd(':', 'bar'))
|
eq(1, funcs.histadd(':', 'bar'))
|
||||||
|
@ -9,7 +9,7 @@ local eq = helpers.eq
|
|||||||
|
|
||||||
local reset = plugin_helpers.reset
|
local reset = plugin_helpers.reset
|
||||||
|
|
||||||
describe('matchparen', function()
|
describe('matchparen', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -17,9 +17,9 @@ describe('ShaDa error handling', function()
|
|||||||
clean()
|
clean()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Note: most of tests have additional items like sX, mX, rX. These are for
|
-- Note: most of tests have additional items like sX, mX, rX. These are for
|
||||||
-- valgrind tests, to check for memory leaks (i.e. whether error handling code
|
-- valgrind tests, to check for memory leaks (i.e. whether error handling code
|
||||||
-- does (not) forget to call ga_clear). Not needed for array-based items like
|
-- does (not) forget to call ga_clear). Not needed for array-based items like
|
||||||
-- history because they are not using ad_ga.
|
-- history because they are not using ad_ga.
|
||||||
|
|
||||||
it('does not fail on empty file', function()
|
it('does not fail on empty file', function()
|
||||||
@ -69,15 +69,15 @@ describe('ShaDa error handling', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('fails on search pattern item with invalid byte', function()
|
it('fails on search pattern item with invalid byte', function()
|
||||||
-- 195 (== 0xC1) cannot start any valid messagepack entry (the only byte
|
-- 195 (== 0xC1) cannot start any valid messagepack entry (the only byte
|
||||||
-- that cannot do this). Specifically unpack_template.h contains
|
-- that cannot do this). Specifically unpack_template.h contains
|
||||||
--
|
--
|
||||||
-- //case 0xc1: // string
|
-- //case 0xc1: // string
|
||||||
-- // again_terminal_trail(NEXT_CS(p), p+1);
|
-- // again_terminal_trail(NEXT_CS(p), p+1);
|
||||||
--
|
--
|
||||||
-- (literally: commented out code) which means that in place of this code
|
-- (literally: commented out code) which means that in place of this code
|
||||||
-- `goto _failed` is used from default: case. I do not know any other way to
|
-- `goto _failed` is used from default: case. I do not know any other way to
|
||||||
-- get MSGPACK_UNPACK_PARSE_ERROR and not MSGPACK_UNPACK_CONTINUE or
|
-- get MSGPACK_UNPACK_PARSE_ERROR and not MSGPACK_UNPACK_CONTINUE or
|
||||||
-- MSGPACK_UNPACK_EXTRA_BYTES.
|
-- MSGPACK_UNPACK_EXTRA_BYTES.
|
||||||
wshada('\002\000\001\193')
|
wshada('\002\000\001\193')
|
||||||
eq('Vim(rshada):E576: Failed to parse ShaDa file due to a msgpack parser error at position 3', exc_exec(sdrcmd()))
|
eq('Vim(rshada):E576: Failed to parse ShaDa file due to a msgpack parser error at position 3', exc_exec(sdrcmd()))
|
||||||
|
@ -194,8 +194,8 @@ describe('ShaDa support code', function()
|
|||||||
reset()
|
reset()
|
||||||
nvim_command('edit ' .. testfilename)
|
nvim_command('edit ' .. testfilename)
|
||||||
nvim_command('normal! Gg;')
|
nvim_command('normal! Gg;')
|
||||||
-- Note: without “sync” “commands” test has good changes to fail for unknown
|
-- Note: without “sync” “commands” test has good changes to fail for unknown
|
||||||
-- reason (in first eq expected 1 is compared with 2). Any command inserted
|
-- reason (in first eq expected 1 is compared with 2). Any command inserted
|
||||||
-- causes this to work properly.
|
-- causes this to work properly.
|
||||||
nvim_command('" sync')
|
nvim_command('" sync')
|
||||||
eq(1, nvim_current_line())
|
eq(1, nvim_current_line())
|
||||||
|
@ -33,7 +33,7 @@ describe('ShaDa support code', function()
|
|||||||
else
|
else
|
||||||
meths.set_var(varname, varval)
|
meths.set_var(varname, varval)
|
||||||
end
|
end
|
||||||
-- Exit during `reset` is not a regular exit: it does not write shada
|
-- Exit during `reset` is not a regular exit: it does not write shada
|
||||||
-- automatically
|
-- automatically
|
||||||
nvim_command('qall')
|
nvim_command('qall')
|
||||||
reset()
|
reset()
|
||||||
|
@ -45,7 +45,7 @@ describe(':edit term://*', function()
|
|||||||
command('edit term://foobar')
|
command('edit term://foobar')
|
||||||
local bufcontents = {}
|
local bufcontents = {}
|
||||||
local winheight = curwinmeths.get_height()
|
local winheight = curwinmeths.get_height()
|
||||||
-- I have no idea why there is + 4 needed. But otherwise it works fine with
|
-- I have no idea why there is + 4 needed. But otherwise it works fine with
|
||||||
-- different scrollbacks.
|
-- different scrollbacks.
|
||||||
local shift = -4
|
local shift = -4
|
||||||
local buf_cont_start = rep_size - 1 - sb - winheight - shift
|
local buf_cont_start = rep_size - 1 - sb - winheight - shift
|
||||||
|
@ -45,7 +45,7 @@ describe('terminal window highlighting', function()
|
|||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
describe(title, function()
|
describe(title, function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
set_attrs_fn()
|
set_attrs_fn()
|
||||||
thelpers.feed_data('text')
|
thelpers.feed_data('text')
|
||||||
|
@ -1314,9 +1314,9 @@ describe("'inccommand' autocommands", function()
|
|||||||
before_each(clear)
|
before_each(clear)
|
||||||
|
|
||||||
-- keys are events to be tested
|
-- keys are events to be tested
|
||||||
-- values are arrays like
|
-- values are arrays like
|
||||||
-- { open = { 1 }, close = { 2, 3} }
|
-- { open = { 1 }, close = { 2, 3} }
|
||||||
-- which would mean that during the test below the event fires for
|
-- which would mean that during the test below the event fires for
|
||||||
-- buffer 1 when opening the preview window, and for buffers 2 and 3
|
-- buffer 1 when opening the preview window, and for buffers 2 and 3
|
||||||
-- when closing the preview window
|
-- when closing the preview window
|
||||||
local eventsExpected = {
|
local eventsExpected = {
|
||||||
@ -1385,7 +1385,7 @@ describe("'inccommand' autocommands", function()
|
|||||||
feed("/<enter>")
|
feed("/<enter>")
|
||||||
|
|
||||||
for event, _ in pairs(eventsExpected) do
|
for event, _ in pairs(eventsExpected) do
|
||||||
eventsObserved[event].close = meths.get_var(event .. "_fired")
|
eventsObserved[event].close = meths.get_var(event .. "_fired")
|
||||||
end
|
end
|
||||||
|
|
||||||
for event, _ in pairs(eventsExpected) do
|
for event, _ in pairs(eventsExpected) do
|
||||||
|
@ -6,9 +6,9 @@ local insert = helpers.insert
|
|||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
|
|
||||||
describe('Screen', function()
|
describe('Screen', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
clear()
|
clear()
|
||||||
screen = Screen.new(nil,10)
|
screen = Screen.new(nil,10)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
@ -17,10 +17,10 @@ describe('Screen', function()
|
|||||||
[1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}
|
[1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}
|
||||||
} )
|
} )
|
||||||
end)
|
end)
|
||||||
|
|
||||||
after_each(function()
|
after_each(function()
|
||||||
screen:detach()
|
screen:detach()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe("match and conceal", function()
|
describe("match and conceal", function()
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ describe('Screen', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('double characters and move the cursor one line up.', function()
|
it('double characters and move the cursor one line up.', function()
|
||||||
feed("k")
|
feed("k")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1:∧} |
|
{1:∧} |
|
||||||
@ -88,7 +88,7 @@ describe('Screen', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('double characters and move the cursor to the second line in the file.', function()
|
it('double characters and move the cursor to the second line in the file.', function()
|
||||||
feed("ggj")
|
feed("ggj")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1:∧} |
|
{1:∧} |
|
||||||
@ -104,7 +104,7 @@ describe('Screen', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('double characters and then move the cursor to the beginning of the file and back to the end of the file.', function()
|
it('double characters and then move the cursor to the beginning of the file and back to the end of the file.', function()
|
||||||
feed("ggG")
|
feed("ggG")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1:∧} |
|
{1:∧} |
|
||||||
@ -119,8 +119,8 @@ describe('Screen', function()
|
|||||||
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end) -- multiple
|
end) -- multiple
|
||||||
|
|
||||||
it("keyword instances in initially in the document.", function()
|
it("keyword instances in initially in the document.", function()
|
||||||
feed("2ilambda<cr><ESC>")
|
feed("2ilambda<cr><ESC>")
|
||||||
execute("let &conceallevel=1")
|
execute("let &conceallevel=1")
|
||||||
@ -141,13 +141,13 @@ describe('Screen', function()
|
|||||||
|
|
||||||
describe("regions in the document", function()
|
describe("regions in the document", function()
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
feed("2")
|
feed("2")
|
||||||
insert("<r> a region of text </r>\n")
|
insert("<r> a region of text </r>\n")
|
||||||
execute("let &conceallevel=1")
|
execute("let &conceallevel=1")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('initially and conceal it.', function()
|
it('initially and conceal it.', function()
|
||||||
execute("syn region rText start='<r>' end='</r>' conceal cchar=R")
|
execute("syn region rText start='<r>' end='</r>' conceal cchar=R")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1:R} |
|
{1:R} |
|
||||||
@ -180,9 +180,9 @@ describe('Screen', function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('that are nested and conceal the nested region\'s start and end tags.', function()
|
it('that are nested and conceal the nested region\'s start and end tags.', function()
|
||||||
execute("syn region rText contains=rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
|
execute("syn region rText contains=rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
|
||||||
insert("<r> A region with <r> a nested <r> nested region.</r> </r> </r>\n")
|
insert("<r> A region with <r> a nested <r> nested region.</r> </r> </r>\n")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } a region of text {1:-} |
|
{1: } a region of text {1:-} |
|
||||||
@ -200,8 +200,8 @@ describe('Screen', function()
|
|||||||
end) -- regions in the document
|
end) -- regions in the document
|
||||||
|
|
||||||
describe("a region of text", function()
|
describe("a region of text", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
execute("syntax conceal on")
|
execute("syntax conceal on")
|
||||||
feed("2")
|
feed("2")
|
||||||
insert("<r> a region of text </r>\n")
|
insert("<r> a region of text </r>\n")
|
||||||
execute("syn region rText start='<r>' end='</r>' cchar=-")
|
execute("syn region rText start='<r>' end='</r>' cchar=-")
|
||||||
@ -257,17 +257,17 @@ describe('Screen', function()
|
|||||||
end) -- a region of text (implicit concealing)
|
end) -- a region of text (implicit concealing)
|
||||||
end) -- match and conceal
|
end) -- match and conceal
|
||||||
|
|
||||||
describe("let the conceal level be", function()
|
describe("let the conceal level be", function()
|
||||||
before_each(function()
|
before_each(function()
|
||||||
insert("// No Conceal\n")
|
insert("// No Conceal\n")
|
||||||
insert('"Conceal without a cchar"\n')
|
insert('"Conceal without a cchar"\n')
|
||||||
insert("+ With cchar\n\n")
|
insert("+ With cchar\n\n")
|
||||||
execute("syn match noConceal '^//.*$'")
|
execute("syn match noConceal '^//.*$'")
|
||||||
execute("syn match concealNoCchar '\".\\{-}\"$' conceal")
|
execute("syn match concealNoCchar '\".\\{-}\"$' conceal")
|
||||||
execute("syn match concealWCchar '^+.\\{-}$' conceal cchar=C")
|
execute("syn match concealWCchar '^+.\\{-}$' conceal cchar=C")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("0. No concealing.", function()
|
it("0. No concealing.", function()
|
||||||
execute("let &conceallevel=0")
|
execute("let &conceallevel=0")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
// No Conceal |
|
// No Conceal |
|
||||||
@ -282,7 +282,7 @@ describe('Screen', function()
|
|||||||
:let &conceallevel=0 |
|
:let &conceallevel=0 |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("1. Conceal using cchar or reference listchars.", function()
|
it("1. Conceal using cchar or reference listchars.", function()
|
||||||
execute("let &conceallevel=1")
|
execute("let &conceallevel=1")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
@ -298,7 +298,7 @@ describe('Screen', function()
|
|||||||
:let &conceallevel=1 |
|
:let &conceallevel=1 |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("2. Hidden unless cchar is set.", function()
|
it("2. Hidden unless cchar is set.", function()
|
||||||
execute("let &conceallevel=2")
|
execute("let &conceallevel=2")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
@ -314,8 +314,8 @@ describe('Screen', function()
|
|||||||
:let &conceallevel=2 |
|
:let &conceallevel=2 |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("3. Hide all concealed text.", function()
|
it("3. Hide all concealed text.", function()
|
||||||
execute("let &conceallevel=3")
|
execute("let &conceallevel=3")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
// No Conceal |
|
// No Conceal |
|
||||||
|
@ -526,7 +526,7 @@ describe('completion', function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
expect([[
|
expect([[
|
||||||
|
|
||||||
June
|
June
|
||||||
June]])
|
June]])
|
||||||
end)
|
end)
|
||||||
@ -773,7 +773,7 @@ describe('completion', function()
|
|||||||
{3:-- Keyword completion (^N^P) }{4:match 2 of 2} |
|
{3:-- Keyword completion (^N^P) }{4:match 2 of 2} |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('from the commandline window', function()
|
describe('from the commandline window', function()
|
||||||
|
|
||||||
it('is cleared after CTRL-C', function ()
|
it('is cleared after CTRL-C', function ()
|
||||||
@ -862,7 +862,7 @@ describe('External completion popupmenu', function()
|
|||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{2:-- INSERT --} |
|
{2:-- INSERT --} |
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq(expected, items)
|
eq(expected, items)
|
||||||
eq(0, selected)
|
eq(0, selected)
|
||||||
eq({1,0}, anchor)
|
eq({1,0}, anchor)
|
||||||
@ -878,7 +878,7 @@ describe('External completion popupmenu', function()
|
|||||||
{1:~ }|
|
{1:~ }|
|
||||||
{1:~ }|
|
{1:~ }|
|
||||||
{2:-- INSERT --} |
|
{2:-- INSERT --} |
|
||||||
]], nil, nil, function()
|
]], nil, nil, function()
|
||||||
eq(expected, items)
|
eq(expected, items)
|
||||||
eq(-1, selected)
|
eq(-1, selected)
|
||||||
eq({1,0}, anchor)
|
eq({1,0}, anchor)
|
||||||
|
@ -32,7 +32,7 @@ describe('json_decode_string()', function()
|
|||||||
it('does not overflow when running with `n…`, `t…`, `f…`', function()
|
it('does not overflow when running with `n…`, `t…`, `f…`', function()
|
||||||
local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN})
|
local rettv = ffi.new('typval_T', {v_type=decode.VAR_UNKNOWN})
|
||||||
decode.emsg_silent = 1
|
decode.emsg_silent = 1
|
||||||
-- This will not crash, but if `len` argument will be ignored it will parse
|
-- This will not crash, but if `len` argument will be ignored it will parse
|
||||||
-- `null` as `null` and if not it will parse `null` as `n`.
|
-- `null` as `null` and if not it will parse `null` as `n`.
|
||||||
eq(0, decode.json_decode_string('null', 1, rettv))
|
eq(0, decode.json_decode_string('null', 1, rettv))
|
||||||
eq(decode.VAR_UNKNOWN, rettv.v_type)
|
eq(decode.VAR_UNKNOWN, rettv.v_type)
|
||||||
|
@ -198,8 +198,8 @@ describe('garray', function()
|
|||||||
local function new_and_grow(itemsize_, growsize_, req)
|
local function new_and_grow(itemsize_, growsize_, req)
|
||||||
local garr = new_garray()
|
local garr = new_garray()
|
||||||
ga_init(garr, itemsize_, growsize_)
|
ga_init(garr, itemsize_, growsize_)
|
||||||
eq(0, ga_size(garr)) -- should be 0 at first
|
eq(0, ga_size(garr)) -- should be 0 at first
|
||||||
eq(NULL, ga_data(garr)) -- should be NULL
|
eq(NULL, ga_data(garr)) -- should be NULL
|
||||||
ga_grow(garr, req) -- add space for `req` items
|
ga_grow(garr, req) -- add space for `req` items
|
||||||
return garr
|
return garr
|
||||||
end
|
end
|
||||||
@ -209,7 +209,7 @@ describe('garray', function()
|
|||||||
growsize = 4
|
growsize = 4
|
||||||
local grow_by = growsize - 1
|
local grow_by = growsize - 1
|
||||||
local garr = new_and_grow(itemsize, growsize, grow_by)
|
local garr = new_and_grow(itemsize, growsize, grow_by)
|
||||||
neq(NULL, ga_data(garr)) -- data should be a ptr to memory
|
neq(NULL, ga_data(garr)) -- data should be a ptr to memory
|
||||||
eq(growsize, ga_maxlen(garr)) -- we requested LESS than growsize, so...
|
eq(growsize, ga_maxlen(garr)) -- we requested LESS than growsize, so...
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ describe('garray', function()
|
|||||||
growsize = 4
|
growsize = 4
|
||||||
local grow_by = growsize + 1
|
local grow_by = growsize + 1
|
||||||
local garr = new_and_grow(itemsize, growsize, grow_by)
|
local garr = new_and_grow(itemsize, growsize, grow_by)
|
||||||
neq(NULL, ga_data(garr)) -- data should be a ptr to memory
|
neq(NULL, ga_data(garr)) -- data should be a ptr to memory
|
||||||
eq(grow_by, ga_maxlen(garr)) -- we requested MORE than growsize, so...
|
eq(grow_by, ga_maxlen(garr)) -- we requested MORE than growsize, so...
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -206,8 +206,8 @@ describe('fs function', function()
|
|||||||
|
|
||||||
lfs.chdir(directory)
|
lfs.chdir(directory)
|
||||||
|
|
||||||
-- Rely on currentdir to resolve symlinks, if any. Testing against
|
-- Rely on currentdir to resolve symlinks, if any. Testing against
|
||||||
-- the absolute path taken from arg[0] may result in failure where
|
-- the absolute path taken from arg[0] may result in failure where
|
||||||
-- the path has a symlink in it.
|
-- the path has a symlink in it.
|
||||||
local canonical = lfs.currentdir() .. '/' .. executable_name
|
local canonical = lfs.currentdir() .. '/' .. executable_name
|
||||||
local expected = exe(canonical)
|
local expected = exe(canonical)
|
||||||
|
@ -13,7 +13,7 @@ describe('vim_strsave_escaped()', function()
|
|||||||
local res = strings.vim_strsave_escaped(to_cstr(s), to_cstr(chars))
|
local res = strings.vim_strsave_escaped(to_cstr(s), to_cstr(chars))
|
||||||
local ret = ffi.string(res)
|
local ret = ffi.string(res)
|
||||||
|
|
||||||
-- Explicitly free memory so we are sure it is allocated: if it was not it
|
-- Explicitly free memory so we are sure it is allocated: if it was not it
|
||||||
-- will crash.
|
-- will crash.
|
||||||
strings.xfree(res)
|
strings.xfree(res)
|
||||||
return ret
|
return ret
|
||||||
@ -44,7 +44,7 @@ describe('vim_strnsave_unquoted()', function()
|
|||||||
local vim_strnsave_unquoted = function(s, len)
|
local vim_strnsave_unquoted = function(s, len)
|
||||||
local res = strings.vim_strnsave_unquoted(to_cstr(s), len or #s)
|
local res = strings.vim_strnsave_unquoted(to_cstr(s), len or #s)
|
||||||
local ret = ffi.string(res)
|
local ret = ffi.string(res)
|
||||||
-- Explicitly free memory so we are sure it is allocated: if it was not it
|
-- Explicitly free memory so we are sure it is allocated: if it was not it
|
||||||
-- will crash.
|
-- will crash.
|
||||||
strings.xfree(res)
|
strings.xfree(res)
|
||||||
return ret
|
return ret
|
||||||
|
2
third-party/cmake/BuildLuarocks.cmake
vendored
2
third-party/cmake/BuildLuarocks.cmake
vendored
@ -144,7 +144,7 @@ if(USE_BUNDLED_BUSTED)
|
|||||||
|
|
||||||
add_custom_command(OUTPUT ${HOSTDEPS_BIN_DIR}/luacheck
|
add_custom_command(OUTPUT ${HOSTDEPS_BIN_DIR}/luacheck
|
||||||
COMMAND ${LUAROCKS_BINARY}
|
COMMAND ${LUAROCKS_BINARY}
|
||||||
ARGS build https://raw.githubusercontent.com/mpeterv/luacheck/3929eaa3528be2a8a50c593d687c8625205a2033/luacheck-scm-1.rockspec ${LUAROCKS_BUILDARGS}
|
ARGS build https://raw.githubusercontent.com/mpeterv/luacheck/master/luacheck-scm-1.rockspec ${LUAROCKS_BUILDARGS}
|
||||||
DEPENDS busted)
|
DEPENDS busted)
|
||||||
add_custom_target(luacheck
|
add_custom_target(luacheck
|
||||||
DEPENDS ${HOSTDEPS_BIN_DIR}/luacheck)
|
DEPENDS ${HOSTDEPS_BIN_DIR}/luacheck)
|
||||||
|
Loading…
Reference in New Issue
Block a user