fix tests

This commit is contained in:
zztrieuzz 2021-12-23 06:02:20 +07:00
parent 38f08137d4
commit e90e12c789
3 changed files with 11 additions and 2 deletions

View File

@ -1,2 +1,5 @@
test:
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)\")"

View File

@ -165,6 +165,14 @@ cond.is_bracket_line = function()
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()
return function(opts)
log.debug('not_inside_quote')

View File

@ -57,7 +57,6 @@ local compare_text = function(linenr, text_after, name, cursor_add, end_cursor)
linenr + #text_after - 1,
true
)
log.debug(new_text)
for i = 1, #text_after, 1 do
local t = string.gsub(text_after[i], '%|', '')
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(col + 1, end_cursor, '\n\n end cursor column error : ' .. name .. '\n')
else
log.debug(p_after)
eq(row, linenr + i - 2, '\n\n cursor row error: ' .. name .. '\n')
p_after = p_after + cursor_add
eq(col, math.max(p_after - 2,0), '\n\n cursor column error : ' .. name .. '\n')