Implement anchor resolution using locators
This commit is contained in:
parent
b7535dfba4
commit
cbe136c0cb
4 changed files with 244 additions and 814 deletions
|
@ -645,11 +645,13 @@ impl Buffer {
|
|||
assert_eq!(insertion_fragment.fragment_id, fragment.id);
|
||||
}
|
||||
|
||||
let insertions = self.snapshot.insertions.items(&());
|
||||
assert_eq!(
|
||||
HashSet::from_iter(insertions.iter().map(|i| &i.fragment_id)).len(),
|
||||
insertions.len()
|
||||
);
|
||||
let mut cursor = self.snapshot.fragments.cursor::<Locator>();
|
||||
for insertion_fragment in self.snapshot.insertions.cursor::<()>() {
|
||||
cursor.seek(&insertion_fragment.fragment_id, Bias::Left, &None);
|
||||
let fragment = cursor.item().unwrap();
|
||||
assert_eq!(insertion_fragment.fragment_id, fragment.id);
|
||||
assert_eq!(insertion_fragment.split_offset, fragment.insertion_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue