From dbc8fc3bfa15f1531f02779c5483c0c187d3a9ca Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 20 Jul 2021 11:43:10 -0700 Subject: [PATCH] Fix assertions in fold map test Co-Authored-By: Nathan Sobo --- zed/src/editor/display_map/fold_map.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zed/src/editor/display_map/fold_map.rs b/zed/src/editor/display_map/fold_map.rs index 069d154291..3b61ab177e 100644 --- a/zed/src/editor/display_map/fold_map.rs +++ b/zed/src/editor/display_map/fold_map.rs @@ -1108,14 +1108,13 @@ mod tests { let mut map = FoldMap::new(buffer.clone(), cx.as_ref()); let (mut writer, _, _) = map.write(cx.as_ref()); - writer.fold( + let (snapshot2, edits) = writer.fold( vec![ InputPoint::new(0, 2)..InputPoint::new(2, 2), InputPoint::new(2, 4)..InputPoint::new(4, 1), ], cx.as_ref(), ); - let (snapshot2, edits) = map.read(cx.as_ref()); assert_eq!(snapshot2.text(), "aa…cc…eeeee"); assert_eq!( edits, @@ -1125,7 +1124,7 @@ mod tests { new_bytes: OutputOffset(2)..OutputOffset(5), }, Edit { - old_bytes: OutputOffset(7)..OutputOffset(18), + old_bytes: OutputOffset(18)..OutputOffset(29), new_bytes: OutputOffset(7)..OutputOffset(10) }, ] @@ -1151,7 +1150,7 @@ mod tests { new_bytes: OutputOffset(0)..OutputOffset(3), }, Edit { - old_bytes: OutputOffset(8)..OutputOffset(8), + old_bytes: OutputOffset(6)..OutputOffset(6), new_bytes: OutputOffset(8)..OutputOffset(11), }, ]