Fix duplicated multi-buffer excerpts (#29193)
- **add test case** - **Merge excerpts more aggressively** - **Randomized test for set_excerpts_for_path** Closes #ISSUE Release Notes: - Fixed duplicted excerpts (and resulting panics) --------- Co-authored-by: João Marcos <marcospb19@hotmail.com>
This commit is contained in:
parent
458ffaa134
commit
3357736aea
5 changed files with 251 additions and 89 deletions
|
@ -760,7 +760,7 @@ async fn test_random_diagnostics_blocks(cx: &mut TestAppContext, mut rng: StdRng
|
|||
|
||||
// The mutated view may contain more than the reference view as
|
||||
// we don't currently shrink excerpts when diagnostics were removed.
|
||||
let mut ref_iter = reference_excerpts.lines();
|
||||
let mut ref_iter = reference_excerpts.lines().filter(|line| *line != "§ -----");
|
||||
let mut next_ref_line = ref_iter.next();
|
||||
let mut skipped_block = false;
|
||||
|
||||
|
@ -768,7 +768,7 @@ async fn test_random_diagnostics_blocks(cx: &mut TestAppContext, mut rng: StdRng
|
|||
if let Some(ref_line) = next_ref_line {
|
||||
if mut_line == ref_line {
|
||||
next_ref_line = ref_iter.next();
|
||||
} else if mut_line.contains('§') {
|
||||
} else if mut_line.contains('§') && mut_line != "§ -----" {
|
||||
skipped_block = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue