fix(ci): tests & lint
This commit is contained in:
parent
ffb5b2b209
commit
e780b8ad4e
4 changed files with 7 additions and 9 deletions
|
|
@ -48,7 +48,7 @@ function M.parse_ansi_text(text)
|
|||
return table.concat(parts)
|
||||
end
|
||||
|
||||
local function apply_highlight(start_line, start_col, end_line, end_col)
|
||||
local function apply_highlight(start_line, start_col, end_col)
|
||||
local hl_group = get_highlight_group()
|
||||
if hl_group then
|
||||
table.insert(highlights, {
|
||||
|
|
@ -73,7 +73,7 @@ function M.parse_ansi_text(text)
|
|||
for char in segment:gmatch('.') do
|
||||
if char == '\n' then
|
||||
if col_pos > start_col then
|
||||
apply_highlight(start_line, start_col, start_line, col_pos)
|
||||
apply_highlight(start_line, start_col, col_pos)
|
||||
end
|
||||
line_num = line_num + 1
|
||||
start_line = line_num
|
||||
|
|
@ -85,7 +85,7 @@ function M.parse_ansi_text(text)
|
|||
end
|
||||
|
||||
if col_pos > start_col then
|
||||
apply_highlight(start_line, start_col, start_line, col_pos)
|
||||
apply_highlight(start_line, start_col, col_pos)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ function M.parse_ansi_text(text)
|
|||
for char in segment:gmatch('.') do
|
||||
if char == '\n' then
|
||||
if col_pos > start_col then
|
||||
apply_highlight(start_line, start_col, start_line, col_pos)
|
||||
apply_highlight(start_line, start_col, col_pos)
|
||||
end
|
||||
line_num = line_num + 1
|
||||
start_line = line_num
|
||||
|
|
@ -114,7 +114,7 @@ function M.parse_ansi_text(text)
|
|||
end
|
||||
|
||||
if col_pos > start_col then
|
||||
apply_highlight(start_line, start_col, start_line, col_pos)
|
||||
apply_highlight(start_line, start_col, col_pos)
|
||||
end
|
||||
end
|
||||
break
|
||||
|
|
|
|||
|
|
@ -242,7 +242,6 @@ local function toggle_run_panel(is_debug)
|
|||
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, test_list_namespace, 0, -1)
|
||||
for _, hl in ipairs(highlights) do
|
||||
local logger = require('cp.log')
|
||||
logger.log(
|
||||
'Applying extmark: buf='
|
||||
.. bufnr
|
||||
|
|
|
|||
|
|
@ -372,7 +372,6 @@ end
|
|||
|
||||
function M.handle_compilation_failure(compilation_stderr)
|
||||
local ansi = require('cp.ansi')
|
||||
local logger = require('cp.log')
|
||||
local clean_text = 'Compilation failed'
|
||||
local highlights = {}
|
||||
|
||||
|
|
@ -405,7 +404,7 @@ function M.handle_compilation_failure(compilation_stderr)
|
|||
end
|
||||
end
|
||||
|
||||
for i, test_case in ipairs(run_panel_state.test_cases) do
|
||||
for _, test_case in ipairs(run_panel_state.test_cases) do
|
||||
test_case.status = 'fail'
|
||||
test_case.actual = clean_text
|
||||
test_case.actual_highlights = highlights
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ describe('ansi parser', function()
|
|||
local message_highlight = result.highlights[2]
|
||||
assert.equals('CpAnsiBold', message_highlight.highlight_group)
|
||||
assert.equals(22, message_highlight.col_start)
|
||||
assert.equals(48, message_highlight.col_end)
|
||||
assert.equals(51, message_highlight.col_end)
|
||||
end)
|
||||
|
||||
it('handles multiline with persistent state', function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue