From 998114848288c5453ac85e65f435174dde8c914b Mon Sep 17 00:00:00 2001 From: David Wendt Date: Mon, 1 Jun 2020 21:56:31 -0400 Subject: [PATCH] Add a test for `BoxBounds.with_size`, since we're using it now --- core/src/html/test.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/html/test.rs b/core/src/html/test.rs index 3fde359ff..952624cae 100644 --- a/core/src/html/test.rs +++ b/core/src/html/test.rs @@ -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();