#[test] fn align_flex_start_with_shrinking_children_with_stretch() { let layout = stretch::node::Node::new( stretch::style::Style { size: stretch::geometry::Size { width: stretch::style::Dimension::Points(500f32), height: stretch::style::Dimension::Points(500f32), ..Default::default() }, ..Default::default() }, vec![&stretch::node::Node::new( stretch::style::Style { align_items: stretch::style::AlignItems::FlexStart, ..Default::default() }, vec![&stretch::node::Node::new( stretch::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, vec![&stretch::node::Node::new( stretch::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() }, vec![], )], )], )], ) .compute_layout(stretch::geometry::Size::undefined()) .unwrap(); assert_eq!(layout.size.width, 500f32); assert_eq!(layout.size.height, 500f32); assert_eq!(layout.location.x, 0f32); assert_eq!(layout.location.y, 0f32); assert_eq!(layout.children[0usize].size.width, 0f32); assert_eq!(layout.children[0usize].size.height, 500f32); 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, 0f32); assert_eq!(layout.children[0usize].children[0usize].size.height, 0f32); assert_eq!(layout.children[0usize].children[0usize].location.x, 0f32); assert_eq!(layout.children[0usize].children[0usize].location.y, 0f32); assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.width, 0f32); assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.height, 0f32); assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.x, 0f32); assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.y, 0f32); }