mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-07-14 10:30:36 +03:00
fix tests
This commit is contained in:
parent
38f08137d4
commit
e90e12c789
3
Makefile
3
Makefile
@ -1,2 +1,5 @@
|
|||||||
test:
|
test:
|
||||||
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
|
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
|
||||||
|
|
||||||
|
test-file:
|
||||||
|
nvim --headless --noplugin -u tests/minimal.vim -c "lua require(\"plenary.busted\").run(\"$(FILE)\")"
|
||||||
|
@ -165,6 +165,14 @@ cond.is_bracket_line = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
cond.inside_quote = function()
|
||||||
|
return function(opts)
|
||||||
|
log.debug('inside_quote')
|
||||||
|
return utils.is_in_quotes(opts.text, opts.col - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
cond.not_inside_quote = function()
|
cond.not_inside_quote = function()
|
||||||
return function(opts)
|
return function(opts)
|
||||||
log.debug('not_inside_quote')
|
log.debug('not_inside_quote')
|
||||||
|
@ -57,7 +57,6 @@ local compare_text = function(linenr, text_after, name, cursor_add, end_cursor)
|
|||||||
linenr + #text_after - 1,
|
linenr + #text_after - 1,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
log.debug(new_text)
|
|
||||||
for i = 1, #text_after, 1 do
|
for i = 1, #text_after, 1 do
|
||||||
local t = string.gsub(text_after[i], '%|', '')
|
local t = string.gsub(text_after[i], '%|', '')
|
||||||
if
|
if
|
||||||
@ -74,7 +73,6 @@ local compare_text = function(linenr, text_after, name, cursor_add, end_cursor)
|
|||||||
eq(row, linenr + i - 2, '\n\n cursor row error: ' .. name .. '\n')
|
eq(row, linenr + i - 2, '\n\n cursor row error: ' .. name .. '\n')
|
||||||
eq(col + 1, end_cursor, '\n\n end cursor column error : ' .. name .. '\n')
|
eq(col + 1, end_cursor, '\n\n end cursor column error : ' .. name .. '\n')
|
||||||
else
|
else
|
||||||
log.debug(p_after)
|
|
||||||
eq(row, linenr + i - 2, '\n\n cursor row error: ' .. name .. '\n')
|
eq(row, linenr + i - 2, '\n\n cursor row error: ' .. name .. '\n')
|
||||||
p_after = p_after + cursor_add
|
p_after = p_after + cursor_add
|
||||||
eq(col, math.max(p_after - 2,0), '\n\n cursor column error : ' .. name .. '\n')
|
eq(col, math.max(p_after - 2,0), '\n\n cursor column error : ' .. name .. '\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user