Add more assertions to investigate #503 in the future
This commit is contained in:
parent
a3ea6a34d9
commit
21eebede37
2 changed files with 6 additions and 4 deletions
|
@ -4952,6 +4952,9 @@ impl Editor {
|
||||||
);
|
);
|
||||||
let offsets =
|
let offsets =
|
||||||
snapshot.summaries_for_anchors::<usize, _>(anchors_with_status.iter().map(|a| &a.1));
|
snapshot.summaries_for_anchors::<usize, _>(anchors_with_status.iter().map(|a| &a.1));
|
||||||
|
assert_eq!(anchors_with_status.len(), 2 * self.selections.len());
|
||||||
|
assert_eq!(offsets.len(), anchors_with_status.len());
|
||||||
|
|
||||||
let offsets = offsets.chunks(2);
|
let offsets = offsets.chunks(2);
|
||||||
let statuses = anchors_with_status
|
let statuses = anchors_with_status
|
||||||
.chunks(2)
|
.chunks(2)
|
||||||
|
|
|
@ -3664,10 +3664,9 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anchor resolution
|
// Anchor resolution
|
||||||
for (anchor, resolved_offset) in anchors
|
let summaries = snapshot.summaries_for_anchors::<usize, _>(&anchors);
|
||||||
.iter()
|
assert_eq!(anchors.len(), summaries.len());
|
||||||
.zip(snapshot.summaries_for_anchors::<usize, _>(&anchors))
|
for (anchor, resolved_offset) in anchors.iter().zip(summaries) {
|
||||||
{
|
|
||||||
assert!(resolved_offset <= snapshot.len());
|
assert!(resolved_offset <= snapshot.len());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
snapshot.summary_for_anchor::<usize>(anchor),
|
snapshot.summary_for_anchor::<usize>(anchor),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue