#[test] fn rounding_fractial_input_1() { let layout = stretch::node::Node::new( stretch::style::Style { flex_direction: stretch::style::FlexDirection::Column, size: stretch::geometry::Size { width: stretch::style::Dimension::Points(100f32), height: stretch::style::Dimension::Points(113.4f32), ..Default::default() }, ..Default::default() }, vec![ &stretch::node::Node::new( stretch::style::Style { flex_grow: 1f32, flex_basis: stretch::style::Dimension::Points(50f32), size: stretch::geometry::Size { height: stretch::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }, vec![], ), &stretch::node::Node::new( stretch::style::Style { flex_grow: 1f32, size: stretch::geometry::Size { height: stretch::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, vec![], ), &stretch::node::Node::new( stretch::style::Style { flex_grow: 1f32, size: stretch::geometry::Size { height: stretch::style::Dimension::Points(10f32), ..Default::default() }, ..Default::default() }, vec![], ), ], ) .compute_layout(stretch::geometry::Size::undefined()) .unwrap(); assert_eq!(layout.size.width, 100f32); assert_eq!(layout.size.height, 113f32); assert_eq!(layout.location.x, 0f32); assert_eq!(layout.location.y, 0f32); assert_eq!(layout.children[0usize].size.width, 100f32); assert_eq!(layout.children[0usize].size.height, 64f32); assert_eq!(layout.children[0usize].location.x, 0f32); assert_eq!(layout.children[0usize].location.y, 0f32); assert_eq!(layout.children[1usize].size.width, 100f32); assert_eq!(layout.children[1usize].size.height, 25f32); assert_eq!(layout.children[1usize].location.x, 0f32); assert_eq!(layout.children[1usize].location.y, 64f32); assert_eq!(layout.children[2usize].size.width, 100f32); assert_eq!(layout.children[2usize].size.height, 24f32); assert_eq!(layout.children[2usize].location.x, 0f32); assert_eq!(layout.children[2usize].location.y, 89f32); }