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