⎇ 7e05de8652da047a4d2a567bc03302e70d633c2c
tests/generated/absolute_layout_in_wrap_reverse_column_container.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
update tests and benchmarks to use new api
1#[test]
2fn absolute_layout_in_wrap_reverse_column_container() {
3 let layout = stretch::node::Node::new(
4 stretch::style::Style {
5 flex_direction: stretch::style::FlexDirection::Column,
6 flex_wrap: stretch::style::FlexWrap::WrapReverse,
7 size: stretch::geometry::Size {
8 width: stretch::style::Dimension::Points(100f32),
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(20f32),
19 height: stretch::style::Dimension::Points(20f32),
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, 100f32);
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, 20f32);
34 assert_eq!(layout.children[0usize].size.height, 20f32);
35 assert_eq!(layout.children[0usize].location.x, 80f32);
36 assert_eq!(layout.children[0usize].location.y, 0f32);
37}