Remove results from movement function return values, and move editor test utilities to test file

This commit is contained in:
Keith Simmons 2022-03-22 10:55:03 -07:00
parent ec7bada586
commit df751867a1
4 changed files with 68 additions and 66 deletions

View file

@ -714,7 +714,7 @@ mod tests {
log::info!("Moving from point {:?}", point);
let moved_right = movement::right(&snapshot, point).unwrap();
let moved_right = movement::right(&snapshot, point);
log::info!("Right {:?}", moved_right);
if point < max_point {
assert!(moved_right > point);
@ -728,7 +728,7 @@ mod tests {
assert_eq!(moved_right, point);
}
let moved_left = movement::left(&snapshot, point).unwrap();
let moved_left = movement::left(&snapshot, point);
log::info!("Left {:?}", moved_left);
if point > min_point {
assert!(moved_left < point);
@ -786,15 +786,15 @@ mod tests {
DisplayPoint::new(1, 0)
);
assert_eq!(
movement::right(&snapshot, DisplayPoint::new(0, 7)).unwrap(),
movement::right(&snapshot, DisplayPoint::new(0, 7)),
DisplayPoint::new(1, 0)
);
assert_eq!(
movement::left(&snapshot, DisplayPoint::new(1, 0)).unwrap(),
movement::left(&snapshot, DisplayPoint::new(1, 0)),
DisplayPoint::new(0, 7)
);
assert_eq!(
movement::up(&snapshot, DisplayPoint::new(1, 10), SelectionGoal::None).unwrap(),
movement::up(&snapshot, DisplayPoint::new(1, 10), SelectionGoal::None),
(DisplayPoint::new(0, 7), SelectionGoal::Column(10))
);
assert_eq!(
@ -802,8 +802,7 @@ mod tests {
&snapshot,
DisplayPoint::new(0, 7),
SelectionGoal::Column(10)
)
.unwrap(),
),
(DisplayPoint::new(1, 10), SelectionGoal::Column(10))
);
assert_eq!(
@ -811,8 +810,7 @@ mod tests {
&snapshot,
DisplayPoint::new(1, 10),
SelectionGoal::Column(10)
)
.unwrap(),
),
(DisplayPoint::new(2, 4), SelectionGoal::Column(10))
);