⎇ a9acf58cd4179aba3230ea7abd27003dc445c034
tests/generated/flex_wrap_wrap_to_child_height.rs
History
Who touched what
raw
[gentest] Refactor gentest to use WebDriver & quote crate.
1#[test]
2fn flex_wrap_wrap_to_child_height() {
3 let layout = stretch::compute(
4 &stretch::style::Node {
5 flex_direction: stretch::style::FlexDirection::Column,
6 children: vec![
7 stretch::style::Node {
8 flex_wrap: stretch::style::FlexWrap::Wrap,
9 align_items: stretch::style::AlignItems::FlexStart,
10 children: vec![stretch::style::Node {
11 flex_direction: stretch::style::FlexDirection::Column,
12 size: stretch::geometry::Size {
13 width: stretch::style::Dimension::Points(100f32),
14 ..Default::default()
15 },
16 children: vec![stretch::style::Node {
17 size: stretch::geometry::Size {
18 width: stretch::style::Dimension::Points(100f32),
19 height: stretch::style::Dimension::Points(100f32),
20 ..Default::default()
21 },
22 ..Default::default()
23 }],
24 ..Default::default()
25 }],
26 ..Default::default()
27 },
28 stretch::style::Node {
29 size: stretch::geometry::Size {
30 width: stretch::style::Dimension::Points(100f32),
31 height: stretch::style::Dimension::Points(100f32),
32 ..Default::default()
33 },
34 ..Default::default()
35 },
36 ],
37 ..Default::default()
38 },
39 stretch::geometry::Size::undefined(),
40 )
41 .unwrap();
42 assert_eq!(layout.size.width, 100f32);
43 assert_eq!(layout.size.height, 200f32);
44 assert_eq!(layout.location.x, 0f32);
45 assert_eq!(layout.location.y, 0f32);
46 assert_eq!(layout.children[0usize].size.width, 100f32);
47 assert_eq!(layout.children[0usize].size.height, 100f32);
48 assert_eq!(layout.children[0usize].location.x, 0f32);
49 assert_eq!(layout.children[0usize].location.y, 0f32);
50 assert_eq!(layout.children[0usize].children[0usize].size.width, 100f32);
51 assert_eq!(layout.children[0usize].children[0usize].size.height, 100f32);
52 assert_eq!(layout.children[0usize].children[0usize].location.x, 0f32);
53 assert_eq!(layout.children[0usize].children[0usize].location.y, 0f32);
54 assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.width, 100f32);
55 assert_eq!(layout.children[0usize].children[0usize].children[0usize].size.height, 100f32);
56 assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.x, 0f32);
57 assert_eq!(layout.children[0usize].children[0usize].children[0usize].location.y, 0f32);
58 assert_eq!(layout.children[1usize].size.width, 100f32);
59 assert_eq!(layout.children[1usize].size.height, 100f32);
60 assert_eq!(layout.children[1usize].location.x, 0f32);
61 assert_eq!(layout.children[1usize].location.y, 100f32);
62}