Add a test for `BoxBounds.with_size`, since we're using it now

This commit is contained in:
David Wendt 2020-06-01 21:56:31 -04:00
parent aae1f0ba7a
commit 9981148482
1 changed files with 12 additions and 0 deletions

View File

@ -230,6 +230,18 @@ fn bounds_size_addassign() {
);
}
#[test]
fn bounds_with_size() {
let pos1 = Position::from((Twips::new(0), Twips::new(5760)));
let size1 = Size::from((Twips::new(7900), Twips::new(500)));
let bounds1 = BoxBounds::from_position_and_size(pos1, size1);
let size2 = Size::from((Twips::new(7780), Twips::new(500)));
let bounds2 = bounds1.with_size(size2);
assert_eq!(bounds2.into_position_and_size(), (pos1, size2))
}
#[test]
fn textformat_merge() {
let mut tf1 = TextFormat::default();