Assert the editor and unmarked texts are the same

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Petros Amoiridis 2023-04-19 20:52:01 +03:00
parent f9c60b98c0
commit b3b8f8532d
No known key found for this signature in database

View file

@ -187,8 +187,9 @@ impl<'a> EditorTestContext<'a> {
"Initial Editor State: \"{}\"",
marked_text.escape_debug().to_string()
));
let (_, selection_ranges) = marked_text_ranges(marked_text, true);
let (unmarked_text, selection_ranges) = marked_text_ranges(marked_text, true);
self.editor.update(self.cx, |editor, cx| {
assert_eq!(editor.text(cx), unmarked_text);
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
s.select_ranges(selection_ranges)
})