⎇ 54e00d63d6d4a99e89ac0934a6bb61e415ab1006
tests/generated/align_flex_start_with_shrinking_children_with_stretch.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
update tests and benchmarks to use new api
1#[test]
2fn align_flex_start_with_shrinking_children_with_stretch() {
3 let layout = stretch::node::Node::new(
4 stretch::style::Style {
5 size: stretch::geometry::Size {
6 width: stretch::style::Dimension::Points(500f32),
7 height: stretch::style::Dimension::Points(500f32),
8 ..Default::default()
9 },
10 ..Default::default()
11 },
12 vec![&stretch::node::Node::new(
13 stretch::style::Style { align_items: stretch::style::AlignItems::FlexStart, ..Default::default() },
14 vec![&stretch::node::Node::new(
15 stretch::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() },
16 vec![&stretch::node::Node::new(
17 stretch::style::Style { flex_grow: 1f32, flex_shrink: 1f32, ..Default::default() },
18 vec![],
19 )],
20 )],
21 )],
22 )
23 .compute_layout(stretch::geometry::Size::undefined())
24 .unwrap();
25 assert_eq!(layout.size.width, 500f32);
26 assert_eq!(layout.size.height, 500f32);
27 assert_eq!(layout.location.x, 0f32);
28 assert_eq!(layout.location.y, 0f32);
29 assert_eq!(layout.children[0usize].size.width, 0f32);
30 assert_eq!(layout.children[0usize].size.height, 500f32);
31 assert_eq!(layout.children[0usize].location.x, 0f32);
32 assert_eq!(layout.children[0usize].location.y, 0f32);
33 assert_eq!(layout.children[0usize].children[0usize].size.width, 0f32);
34 assert_eq!(layout.children[0usize].children[0usize].size.height, 0f32);
35 assert_eq!(layout.children[0usize].children[0usize].location.x, 0f32);
36 assert_eq!(layout.children[0usize].children[0usize].location.y, 0f32);
37 assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.width, 0f32);
38 assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.height, 0f32);
39 assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.x, 0f32);
40 assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.y, 0f32);
41}