Skip to content

Commit

Permalink
fix missing/duped line case
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Oct 16, 2024
1 parent 545dda1 commit f21f72d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ pub fn extract<'i, I: IndexData + 'i>(
let last_idx = blocks.len() - 1;
active_block = blocks.remove(last_idx);
}
start_printing = prev_section_end;
// prev_section_end' line already contained in some block, so start
// from next one. (Except from case from State::Printing and empty active_block,
// idk?).
start_printing = prev_section_end + 1;
} else {
start_printing = section_start.saturating_sub(config.context_lines);
}
Expand Down Expand Up @@ -206,6 +209,7 @@ pub fn extract<'i, I: IndexData + 'i>(
State::Printing => {
if lines[i].score <= config.block_separator_max_score {
if !active_block.is_empty() {
active_block.push(lines[i].line);
blocks.push(mem::replace(&mut active_block, vec![]));
}
prev_section_end = i;
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Runner group name: 'Default Larger Runners'
Machine name: 'runner'
##[group]Operating System
Ubuntu
LTS
20.04.6
LTS
##[endgroup]
##[group]Runner Image
Expand Down

0 comments on commit f21f72d

Please sign in to comment.