⎇ bce89b1006f36ce35abfaf1f1c2b3dd95f3dffd3
tests/generated/flex_wrap_wrap_to_child_height.rs
Historia
Quién tocó qué
crudo
index: update tests to API changes
1#[test]
2fn flex_wrap_wrap_to_child_height() {
3 let mut stretch = stretch::Stretch::new();
4 let node000 = stretch
5 .new_node(
6 stretch::style::Style {
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![],
15 )
16 .unwrap();
17 let node00 = stretch
18 .new_node(
19 stretch::style::Style {
20 flex_direction: stretch::style::FlexDirection::Column,
21 size: stretch::geometry::Size {
22 width: stretch::style::Dimension::Points(100f32),
23 ..Default::default()
24 },
25 ..Default::default()
26 },
27 vec![node000],
28 )
29 .unwrap();
30 let node0 = stretch
31 .new_node(
32 stretch::style::Style {
33 flex_wrap: stretch::style::FlexWrap::Wrap,
34 align_items: stretch::style::AlignItems::FlexStart,
35 ..Default::default()
36 },
37 vec![node00],
38 )
39 .unwrap();
40 let node1 = stretch
41 .new_node(
42 stretch::style::Style {
43 size: stretch::geometry::Size {
44 width: stretch::style::Dimension::Points(100f32),
45 height: stretch::style::Dimension::Points(100f32),
46 ..Default::default()
47 },
48 ..Default::default()
49 },
50 vec![],
51 )
52 .unwrap();
53 let node = stretch
54 .new_node(
55 stretch::style::Style { flex_direction: stretch::style::FlexDirection::Column, ..Default::default() },
56 vec![node0, node1],
57 )
58 .unwrap();
59 stretch.compute_layout(node, stretch::geometry::Size::undefined()).unwrap();
60 assert_eq!(stretch.layout(node).unwrap().size.width, 100f32);
61 assert_eq!(stretch.layout(node).unwrap().size.height, 200f32);
62 assert_eq!(stretch.layout(node).unwrap().location.x, 0f32);
63 assert_eq!(stretch.layout(node).unwrap().location.y, 0f32);
64 assert_eq!(stretch.layout(node0).unwrap().size.width, 100f32);
65 assert_eq!(stretch.layout(node0).unwrap().size.height, 100f32);
66 assert_eq!(stretch.layout(node0).unwrap().location.x, 0f32);
67 assert_eq!(stretch.layout(node0).unwrap().location.y, 0f32);
68 assert_eq!(stretch.layout(node00).unwrap().size.width, 100f32);
69 assert_eq!(stretch.layout(node00).unwrap().size.height, 100f32);
70 assert_eq!(stretch.layout(node00).unwrap().location.x, 0f32);
71 assert_eq!(stretch.layout(node00).unwrap().location.y, 0f32);
72 assert_eq!(stretch.layout(node000).unwrap().size.width, 100f32);
73 assert_eq!(stretch.layout(node000).unwrap().size.height, 100f32);
74 assert_eq!(stretch.layout(node000).unwrap().location.x, 0f32);
75 assert_eq!(stretch.layout(node000).unwrap().location.y, 0f32);
76 assert_eq!(stretch.layout(node1).unwrap().size.width, 100f32);
77 assert_eq!(stretch.layout(node1).unwrap().size.height, 100f32);
78 assert_eq!(stretch.layout(node1).unwrap().location.x, 0f32);
79 assert_eq!(stretch.layout(node1).unwrap().location.y, 100f32);
80}