Rename FlexboxLayout back to Style (#251)
1#[test]
2fn gap_row_gap_align_items_end() {
3 let mut taffy = taffy::Taffy::new();
4 let node0 = taffy
5 .new_with_children(
6 taffy::style::Style {
7 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
8 ..Default::default()
9 },
10 &[],
11 )
12 .unwrap();
13 let node1 = taffy
14 .new_with_children(
15 taffy::style::Style {
16 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
17 ..Default::default()
18 },
19 &[],
20 )
21 .unwrap();
22 let node2 = taffy
23 .new_with_children(
24 taffy::style::Style {
25 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
26 ..Default::default()
27 },
28 &[],
29 )
30 .unwrap();
31 let node3 = taffy
32 .new_with_children(
33 taffy::style::Style {
34 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
35 ..Default::default()
36 },
37 &[],
38 )
39 .unwrap();
40 let node4 = taffy
41 .new_with_children(
42 taffy::style::Style {
43 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
44 ..Default::default()
45 },
46 &[],
47 )
48 .unwrap();
49 let node5 = taffy
50 .new_with_children(
51 taffy::style::Style {
52 size: taffy::geometry::Size { width: taffy::style::Dimension::Points(20f32), ..Default::default() },
53 ..Default::default()
54 },
55 &[],
56 )
57 .unwrap();
58 let node = taffy
59 .new_with_children(
60 taffy::style::Style {
61 flex_wrap: taffy::style::FlexWrap::Wrap,
62 align_items: taffy::style::AlignItems::FlexEnd,
63 gap: taffy::geometry::Size {
64 width: taffy::style::Dimension::Points(10f32),
65 height: taffy::style::Dimension::Points(20f32),
66 ..Default::default()
67 },
68 size: taffy::geometry::Size {
69 width: taffy::style::Dimension::Points(100f32),
70 height: taffy::style::Dimension::Points(200f32),
71 ..Default::default()
72 },
73 ..Default::default()
74 },
75 &[node0, node1, node2, node3, node4, node5],
76 )
77 .unwrap();
78 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
79 assert_eq!(taffy.layout(node).unwrap().size.width, 100f32);
80 assert_eq!(taffy.layout(node).unwrap().size.height, 200f32);
81 assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
82 assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
83 assert_eq!(taffy.layout(node0).unwrap().size.width, 20f32);
84 assert_eq!(taffy.layout(node0).unwrap().size.height, 0f32);
85 assert_eq!(taffy.layout(node0).unwrap().location.x, 0f32);
86 assert_eq!(taffy.layout(node0).unwrap().location.y, 90f32);
87 assert_eq!(taffy.layout(node1).unwrap().size.width, 20f32);
88 assert_eq!(taffy.layout(node1).unwrap().size.height, 0f32);
89 assert_eq!(taffy.layout(node1).unwrap().location.x, 30f32);
90 assert_eq!(taffy.layout(node1).unwrap().location.y, 90f32);
91 assert_eq!(taffy.layout(node2).unwrap().size.width, 20f32);
92 assert_eq!(taffy.layout(node2).unwrap().size.height, 0f32);
93 assert_eq!(taffy.layout(node2).unwrap().location.x, 60f32);
94 assert_eq!(taffy.layout(node2).unwrap().location.y, 90f32);
95 assert_eq!(taffy.layout(node3).unwrap().size.width, 20f32);
96 assert_eq!(taffy.layout(node3).unwrap().size.height, 0f32);
97 assert_eq!(taffy.layout(node3).unwrap().location.x, 0f32);
98 assert_eq!(taffy.layout(node3).unwrap().location.y, 200f32);
99 assert_eq!(taffy.layout(node4).unwrap().size.width, 20f32);
100 assert_eq!(taffy.layout(node4).unwrap().size.height, 0f32);
101 assert_eq!(taffy.layout(node4).unwrap().location.x, 30f32);
102 assert_eq!(taffy.layout(node4).unwrap().location.y, 200f32);
103 assert_eq!(taffy.layout(node5).unwrap().size.width, 20f32);
104 assert_eq!(taffy.layout(node5).unwrap().size.height, 0f32);
105 assert_eq!(taffy.layout(node5).unwrap().location.x, 60f32);
106 assert_eq!(taffy.layout(node5).unwrap().location.y, 200f32);
107}