tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definiciones

⎇ float-layout tests/generated/grid/grid_auto_columns_fixed_width.rs Rust · 328 líneas · 23.4 KB Historia Quién tocó qué crudo

Use tagged pointer to represent size/length values (#769) afa6437b0 · Nico Burns ·

1#[test]
2#[allow(non_snake_case)]
3fn grid_auto_columns_fixed_width__border_box() {
4    #[allow(unused_imports)]
5    use taffy::{prelude::*, Layout};
6    let mut taffy = crate::new_test_tree();
7    let node0 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
8    let node1 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
9    let node2 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
10    let node3 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
11    let node4 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
12    let node5 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
13    let node6 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
14    let node7 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
15    let node8 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
16    let node9 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
17    let node10 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
18    let node11 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
19    let node12 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
20    let node13 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
21    let node14 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
22    let node15 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
23    let node = taffy
24        .new_with_children(
25            taffy::style::Style {
26                display: taffy::style::Display::Grid,
27                grid_template_rows: vec![length(40f32), auto(), length(40f32), auto()],
28                grid_template_columns: vec![length(40f32), auto(), length(40f32), auto()],
29                size: taffy::geometry::Size {
30                    width: taffy::style::Dimension::from_length(200f32),
31                    height: taffy::style::Dimension::from_length(200f32),
32                },
33                ..Default::default()
34            },
35            &[
36                node0, node1, node2, node3, node4, node5, node6, node7, node8, node9, node10, node11, node12, node13,
37                node14, node15,
38            ],
39        )
40        .unwrap();
41    taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
42    println!("\nComputed tree:");
43    taffy.print_tree(node);
44    println!();
45    let layout = taffy.layout(node).unwrap();
46    let Layout { size, location, .. } = layout;
47    assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node, 200f32, size.width);
48    assert_eq!(size.height, 200f32, "height of node {:?}. Expected {}. Actual {}", node, 200f32, size.height);
49    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
50    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
51    let layout = taffy.layout(node0).unwrap();
52    let Layout { size, location, .. } = layout;
53    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node0, 40f32, size.width);
54    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node0, 40f32, size.height);
55    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
56    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
57    let layout = taffy.layout(node1).unwrap();
58    let Layout { size, location, .. } = layout;
59    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node1, 60f32, size.width);
60    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node1, 40f32, size.height);
61    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node1, 40f32, location.x);
62    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node1, 0f32, location.y);
63    let layout = taffy.layout(node2).unwrap();
64    let Layout { size, location, .. } = layout;
65    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node2, 40f32, size.width);
66    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node2, 40f32, size.height);
67    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node2, 100f32, location.x);
68    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node2, 0f32, location.y);
69    let layout = taffy.layout(node3).unwrap();
70    let Layout { size, location, .. } = layout;
71    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node3, 60f32, size.width);
72    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node3, 40f32, size.height);
73    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node3, 140f32, location.x);
74    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node3, 0f32, location.y);
75    let layout = taffy.layout(node4).unwrap();
76    let Layout { size, location, .. } = layout;
77    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node4, 40f32, size.width);
78    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node4, 60f32, size.height);
79    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node4, 0f32, location.x);
80    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node4, 40f32, location.y);
81    let layout = taffy.layout(node5).unwrap();
82    let Layout { size, location, .. } = layout;
83    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node5, 60f32, size.width);
84    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node5, 60f32, size.height);
85    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node5, 40f32, location.x);
86    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node5, 40f32, location.y);
87    let layout = taffy.layout(node6).unwrap();
88    let Layout { size, location, .. } = layout;
89    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node6, 40f32, size.width);
90    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node6, 60f32, size.height);
91    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node6, 100f32, location.x);
92    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node6, 40f32, location.y);
93    let layout = taffy.layout(node7).unwrap();
94    let Layout { size, location, .. } = layout;
95    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node7, 60f32, size.width);
96    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node7, 60f32, size.height);
97    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node7, 140f32, location.x);
98    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node7, 40f32, location.y);
99    let layout = taffy.layout(node8).unwrap();
100    let Layout { size, location, .. } = layout;
101    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node8, 40f32, size.width);
102    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node8, 40f32, size.height);
103    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node8, 0f32, location.x);
104    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node8, 100f32, location.y);
105    let layout = taffy.layout(node9).unwrap();
106    let Layout { size, location, .. } = layout;
107    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node9, 60f32, size.width);
108    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node9, 40f32, size.height);
109    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node9, 40f32, location.x);
110    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node9, 100f32, location.y);
111    let layout = taffy.layout(node10).unwrap();
112    let Layout { size, location, .. } = layout;
113    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node10, 40f32, size.width);
114    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node10, 40f32, size.height);
115    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node10, 100f32, location.x);
116    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node10, 100f32, location.y);
117    let layout = taffy.layout(node11).unwrap();
118    let Layout { size, location, .. } = layout;
119    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node11, 60f32, size.width);
120    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node11, 40f32, size.height);
121    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node11, 140f32, location.x);
122    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node11, 100f32, location.y);
123    let layout = taffy.layout(node12).unwrap();
124    let Layout { size, location, .. } = layout;
125    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node12, 40f32, size.width);
126    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node12, 60f32, size.height);
127    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node12, 0f32, location.x);
128    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node12, 140f32, location.y);
129    let layout = taffy.layout(node13).unwrap();
130    let Layout { size, location, .. } = layout;
131    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node13, 60f32, size.width);
132    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node13, 60f32, size.height);
133    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node13, 40f32, location.x);
134    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node13, 140f32, location.y);
135    let layout = taffy.layout(node14).unwrap();
136    let Layout { size, location, .. } = layout;
137    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node14, 40f32, size.width);
138    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node14, 60f32, size.height);
139    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node14, 100f32, location.x);
140    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node14, 140f32, location.y);
141    let layout = taffy.layout(node15).unwrap();
142    let Layout { size, location, .. } = layout;
143    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node15, 60f32, size.width);
144    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node15, 60f32, size.height);
145    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node15, 140f32, location.x);
146    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node15, 140f32, location.y);
147}
148
149#[test]
150#[allow(non_snake_case)]
151fn grid_auto_columns_fixed_width__content_box() {
152    #[allow(unused_imports)]
153    use taffy::{prelude::*, Layout};
154    let mut taffy = crate::new_test_tree();
155    let node0 = taffy
156        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
157        .unwrap();
158    let node1 = taffy
159        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
160        .unwrap();
161    let node2 = taffy
162        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
163        .unwrap();
164    let node3 = taffy
165        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
166        .unwrap();
167    let node4 = taffy
168        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
169        .unwrap();
170    let node5 = taffy
171        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
172        .unwrap();
173    let node6 = taffy
174        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
175        .unwrap();
176    let node7 = taffy
177        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
178        .unwrap();
179    let node8 = taffy
180        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
181        .unwrap();
182    let node9 = taffy
183        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
184        .unwrap();
185    let node10 = taffy
186        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
187        .unwrap();
188    let node11 = taffy
189        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
190        .unwrap();
191    let node12 = taffy
192        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
193        .unwrap();
194    let node13 = taffy
195        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
196        .unwrap();
197    let node14 = taffy
198        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
199        .unwrap();
200    let node15 = taffy
201        .new_leaf(taffy::style::Style { box_sizing: taffy::style::BoxSizing::ContentBox, ..Default::default() })
202        .unwrap();
203    let node = taffy
204        .new_with_children(
205            taffy::style::Style {
206                display: taffy::style::Display::Grid,
207                box_sizing: taffy::style::BoxSizing::ContentBox,
208                grid_template_rows: vec![length(40f32), auto(), length(40f32), auto()],
209                grid_template_columns: vec![length(40f32), auto(), length(40f32), auto()],
210                size: taffy::geometry::Size {
211                    width: taffy::style::Dimension::from_length(200f32),
212                    height: taffy::style::Dimension::from_length(200f32),
213                },
214                ..Default::default()
215            },
216            &[
217                node0, node1, node2, node3, node4, node5, node6, node7, node8, node9, node10, node11, node12, node13,
218                node14, node15,
219            ],
220        )
221        .unwrap();
222    taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
223    println!("\nComputed tree:");
224    taffy.print_tree(node);
225    println!();
226    let layout = taffy.layout(node).unwrap();
227    let Layout { size, location, .. } = layout;
228    assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node, 200f32, size.width);
229    assert_eq!(size.height, 200f32, "height of node {:?}. Expected {}. Actual {}", node, 200f32, size.height);
230    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
231    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
232    let layout = taffy.layout(node0).unwrap();
233    let Layout { size, location, .. } = layout;
234    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node0, 40f32, size.width);
235    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node0, 40f32, size.height);
236    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
237    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
238    let layout = taffy.layout(node1).unwrap();
239    let Layout { size, location, .. } = layout;
240    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node1, 60f32, size.width);
241    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node1, 40f32, size.height);
242    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node1, 40f32, location.x);
243    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node1, 0f32, location.y);
244    let layout = taffy.layout(node2).unwrap();
245    let Layout { size, location, .. } = layout;
246    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node2, 40f32, size.width);
247    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node2, 40f32, size.height);
248    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node2, 100f32, location.x);
249    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node2, 0f32, location.y);
250    let layout = taffy.layout(node3).unwrap();
251    let Layout { size, location, .. } = layout;
252    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node3, 60f32, size.width);
253    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node3, 40f32, size.height);
254    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node3, 140f32, location.x);
255    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node3, 0f32, location.y);
256    let layout = taffy.layout(node4).unwrap();
257    let Layout { size, location, .. } = layout;
258    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node4, 40f32, size.width);
259    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node4, 60f32, size.height);
260    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node4, 0f32, location.x);
261    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node4, 40f32, location.y);
262    let layout = taffy.layout(node5).unwrap();
263    let Layout { size, location, .. } = layout;
264    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node5, 60f32, size.width);
265    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node5, 60f32, size.height);
266    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node5, 40f32, location.x);
267    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node5, 40f32, location.y);
268    let layout = taffy.layout(node6).unwrap();
269    let Layout { size, location, .. } = layout;
270    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node6, 40f32, size.width);
271    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node6, 60f32, size.height);
272    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node6, 100f32, location.x);
273    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node6, 40f32, location.y);
274    let layout = taffy.layout(node7).unwrap();
275    let Layout { size, location, .. } = layout;
276    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node7, 60f32, size.width);
277    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node7, 60f32, size.height);
278    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node7, 140f32, location.x);
279    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node7, 40f32, location.y);
280    let layout = taffy.layout(node8).unwrap();
281    let Layout { size, location, .. } = layout;
282    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node8, 40f32, size.width);
283    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node8, 40f32, size.height);
284    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node8, 0f32, location.x);
285    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node8, 100f32, location.y);
286    let layout = taffy.layout(node9).unwrap();
287    let Layout { size, location, .. } = layout;
288    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node9, 60f32, size.width);
289    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node9, 40f32, size.height);
290    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node9, 40f32, location.x);
291    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node9, 100f32, location.y);
292    let layout = taffy.layout(node10).unwrap();
293    let Layout { size, location, .. } = layout;
294    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node10, 40f32, size.width);
295    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node10, 40f32, size.height);
296    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node10, 100f32, location.x);
297    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node10, 100f32, location.y);
298    let layout = taffy.layout(node11).unwrap();
299    let Layout { size, location, .. } = layout;
300    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node11, 60f32, size.width);
301    assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node11, 40f32, size.height);
302    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node11, 140f32, location.x);
303    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node11, 100f32, location.y);
304    let layout = taffy.layout(node12).unwrap();
305    let Layout { size, location, .. } = layout;
306    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node12, 40f32, size.width);
307    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node12, 60f32, size.height);
308    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node12, 0f32, location.x);
309    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node12, 140f32, location.y);
310    let layout = taffy.layout(node13).unwrap();
311    let Layout { size, location, .. } = layout;
312    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node13, 60f32, size.width);
313    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node13, 60f32, size.height);
314    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node13, 40f32, location.x);
315    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node13, 140f32, location.y);
316    let layout = taffy.layout(node14).unwrap();
317    let Layout { size, location, .. } = layout;
318    assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node14, 40f32, size.width);
319    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node14, 60f32, size.height);
320    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node14, 100f32, location.x);
321    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node14, 140f32, location.y);
322    let layout = taffy.layout(node15).unwrap();
323    let Layout { size, location, .. } = layout;
324    assert_eq!(size.width, 60f32, "width of node {:?}. Expected {}. Actual {}", node15, 60f32, size.width);
325    assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node15, 60f32, size.height);
326    assert_eq!(location.x, 140f32, "x of node {:?}. Expected {}. Actual {}", node15, 140f32, location.x);
327    assert_eq!(location.y, 140f32, "y of node {:?}. Expected {}. Actual {}", node15, 140f32, location.y);
328}