#[test] fn flex_grow_within_constrained_max_width() { let layout = stretch::compute( &stretch::style::Node { flex_direction: stretch::style::FlexDirection::Column, size: stretch::geometry::Size { width: stretch::style::Dimension::Points(200f32), height: stretch::style::Dimension::Points(100f32), ..Default::default() }, children: vec![stretch::style::Node { max_size: stretch::geometry::Size { width: stretch::style::Dimension::Points(300f32), ..Default::default() }, children: vec![stretch::style::Node { flex_grow: 1f32, size: stretch::geometry::Size { height: stretch::style::Dimension::Points(20f32), ..Default::default() }, ..Default::default() }], ..Default::default() }], ..Default::default() }, stretch::geometry::Size::undefined(), ) .unwrap(); assert_eq!(layout.size.width, 200f32); assert_eq!(layout.size.height, 100f32); assert_eq!(layout.location.x, 0f32); assert_eq!(layout.location.y, 0f32); assert_eq!(layout.children[0usize].size.width, 200f32); assert_eq!(layout.children[0usize].size.height, 20f32); assert_eq!(layout.children[0usize].location.x, 0f32); assert_eq!(layout.children[0usize].location.y, 0f32); assert_eq!(layout.children[0usize].children[0usize].size.width, 200f32); assert_eq!(layout.children[0usize].children[0usize].size.height, 20f32); assert_eq!(layout.children[0usize].children[0usize].location.x, 0f32); assert_eq!(layout.children[0usize].children[0usize].location.y, 0f32); }