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();