tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definiciones

⎇ float-layout tests/generated/grid/grid_align_items_baseline_complex.rs Rust · 471 líneas · 25.3 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_align_items_baseline_complex__border_box() {
4    #[allow(unused_imports)]
5    use taffy::{prelude::*, Layout};
6    let mut taffy = crate::new_test_tree();
7    let node0 = taffy
8        .new_leaf(taffy::style::Style {
9            size: taffy::geometry::Size {
10                width: taffy::style::Dimension::from_length(20f32),
11                height: taffy::style::Dimension::from_length(20f32),
12            },
13            ..Default::default()
14        })
15        .unwrap();
16    let node10 = taffy
17        .new_leaf(taffy::style::Style {
18            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
19            ..Default::default()
20        })
21        .unwrap();
22    let node1 = taffy
23        .new_with_children(
24            taffy::style::Style {
25                size: taffy::geometry::Size {
26                    width: taffy::style::Dimension::from_length(20f32),
27                    height: taffy::style::Dimension::from_length(20f32),
28                },
29                ..Default::default()
30            },
31            &[node10],
32        )
33        .unwrap();
34    let node20 = taffy
35        .new_leaf(taffy::style::Style {
36            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
37            ..Default::default()
38        })
39        .unwrap();
40    let node2 = taffy
41        .new_with_children(
42            taffy::style::Style {
43                size: taffy::geometry::Size {
44                    width: taffy::style::Dimension::from_length(20f32),
45                    height: taffy::style::Dimension::from_length(20f32),
46                },
47                ..Default::default()
48            },
49            &[node20],
50        )
51        .unwrap();
52    let node3 = taffy
53        .new_leaf(taffy::style::Style {
54            size: taffy::geometry::Size {
55                width: taffy::style::Dimension::from_length(20f32),
56                height: taffy::style::Dimension::from_length(20f32),
57            },
58            ..Default::default()
59        })
60        .unwrap();
61    let node4 = taffy
62        .new_leaf(taffy::style::Style {
63            size: taffy::geometry::Size {
64                width: taffy::style::Dimension::from_length(20f32),
65                height: taffy::style::Dimension::from_length(20f32),
66            },
67            ..Default::default()
68        })
69        .unwrap();
70    let node5 = taffy
71        .new_leaf(taffy::style::Style {
72            size: taffy::geometry::Size {
73                width: taffy::style::Dimension::from_length(20f32),
74                height: taffy::style::Dimension::from_length(20f32),
75            },
76            ..Default::default()
77        })
78        .unwrap();
79    let node60 = taffy
80        .new_leaf(taffy::style::Style {
81            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
82            ..Default::default()
83        })
84        .unwrap();
85    let node6 = taffy
86        .new_with_children(
87            taffy::style::Style {
88                size: taffy::geometry::Size {
89                    width: taffy::style::Dimension::from_length(20f32),
90                    height: taffy::style::Dimension::from_length(20f32),
91                },
92                ..Default::default()
93            },
94            &[node60],
95        )
96        .unwrap();
97    let node70 = taffy
98        .new_leaf(taffy::style::Style {
99            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(5f32) },
100            ..Default::default()
101        })
102        .unwrap();
103    let node7 = taffy
104        .new_with_children(
105            taffy::style::Style {
106                size: taffy::geometry::Size {
107                    width: taffy::style::Dimension::from_length(20f32),
108                    height: taffy::style::Dimension::from_length(20f32),
109                },
110                ..Default::default()
111            },
112            &[node70],
113        )
114        .unwrap();
115    let node8 = taffy
116        .new_leaf(taffy::style::Style {
117            size: taffy::geometry::Size {
118                width: taffy::style::Dimension::from_length(20f32),
119                height: taffy::style::Dimension::from_length(20f32),
120            },
121            ..Default::default()
122        })
123        .unwrap();
124    let node = taffy
125        .new_with_children(
126            taffy::style::Style {
127                display: taffy::style::Display::Grid,
128                align_items: Some(taffy::style::AlignItems::Baseline),
129                grid_template_rows: vec![length(40f32), length(40f32), length(40f32)],
130                grid_template_columns: vec![length(40f32), length(40f32), length(40f32)],
131                size: taffy::geometry::Size {
132                    width: taffy::style::Dimension::from_length(120f32),
133                    height: taffy::style::Dimension::from_length(120f32),
134                },
135                ..Default::default()
136            },
137            &[node0, node1, node2, node3, node4, node5, node6, node7, node8],
138        )
139        .unwrap();
140    taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
141    println!("\nComputed tree:");
142    taffy.print_tree(node);
143    println!();
144    let layout = taffy.layout(node).unwrap();
145    let Layout { size, location, .. } = layout;
146    assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node, 120f32, size.width);
147    assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node, 120f32, size.height);
148    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
149    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
150    let layout = taffy.layout(node0).unwrap();
151    let Layout { size, location, .. } = layout;
152    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node0, 20f32, size.width);
153    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node0, 20f32, size.height);
154    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
155    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
156    let layout = taffy.layout(node1).unwrap();
157    let Layout { size, location, .. } = layout;
158    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node1, 20f32, size.width);
159    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node1, 20f32, size.height);
160    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node1, 40f32, location.x);
161    assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1, 10f32, location.y);
162    let layout = taffy.layout(node10).unwrap();
163    let Layout { size, location, .. } = layout;
164    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node10, 0f32, size.width);
165    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node10, 10f32, size.height);
166    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node10, 0f32, location.x);
167    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node10, 0f32, location.y);
168    let layout = taffy.layout(node2).unwrap();
169    let Layout { size, location, .. } = layout;
170    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node2, 20f32, size.width);
171    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node2, 20f32, size.height);
172    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node2, 80f32, location.x);
173    assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node2, 10f32, location.y);
174    let layout = taffy.layout(node20).unwrap();
175    let Layout { size, location, .. } = layout;
176    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node20, 0f32, size.width);
177    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node20, 10f32, size.height);
178    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node20, 0f32, location.x);
179    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node20, 0f32, location.y);
180    let layout = taffy.layout(node3).unwrap();
181    let Layout { size, location, .. } = layout;
182    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node3, 20f32, size.width);
183    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node3, 20f32, size.height);
184    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node3, 0f32, location.x);
185    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node3, 40f32, location.y);
186    let layout = taffy.layout(node4).unwrap();
187    let Layout { size, location, .. } = layout;
188    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node4, 20f32, size.width);
189    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node4, 20f32, size.height);
190    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node4, 40f32, location.x);
191    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node4, 40f32, location.y);
192    let layout = taffy.layout(node5).unwrap();
193    let Layout { size, location, .. } = layout;
194    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node5, 20f32, size.width);
195    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node5, 20f32, size.height);
196    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node5, 80f32, location.x);
197    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node5, 40f32, location.y);
198    let layout = taffy.layout(node6).unwrap();
199    let Layout { size, location, .. } = layout;
200    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node6, 20f32, size.width);
201    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node6, 20f32, size.height);
202    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node6, 0f32, location.x);
203    assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node6, 90f32, location.y);
204    let layout = taffy.layout(node60).unwrap();
205    let Layout { size, location, .. } = layout;
206    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node60, 0f32, size.width);
207    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node60, 10f32, size.height);
208    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node60, 0f32, location.x);
209    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node60, 0f32, location.y);
210    let layout = taffy.layout(node7).unwrap();
211    let Layout { size, location, .. } = layout;
212    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node7, 20f32, size.width);
213    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node7, 20f32, size.height);
214    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node7, 40f32, location.x);
215    assert_eq!(location.y, 95f32, "y of node {:?}. Expected {}. Actual {}", node7, 95f32, location.y);
216    let layout = taffy.layout(node70).unwrap();
217    let Layout { size, location, .. } = layout;
218    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node70, 0f32, size.width);
219    assert_eq!(size.height, 5f32, "height of node {:?}. Expected {}. Actual {}", node70, 5f32, size.height);
220    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node70, 0f32, location.x);
221    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node70, 0f32, location.y);
222    let layout = taffy.layout(node8).unwrap();
223    let Layout { size, location, .. } = layout;
224    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node8, 20f32, size.width);
225    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node8, 20f32, size.height);
226    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node8, 80f32, location.x);
227    assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node8, 80f32, location.y);
228}
229
230#[test]
231#[allow(non_snake_case)]
232fn grid_align_items_baseline_complex__content_box() {
233    #[allow(unused_imports)]
234    use taffy::{prelude::*, Layout};
235    let mut taffy = crate::new_test_tree();
236    let node0 = taffy
237        .new_leaf(taffy::style::Style {
238            box_sizing: taffy::style::BoxSizing::ContentBox,
239            size: taffy::geometry::Size {
240                width: taffy::style::Dimension::from_length(20f32),
241                height: taffy::style::Dimension::from_length(20f32),
242            },
243            ..Default::default()
244        })
245        .unwrap();
246    let node10 = taffy
247        .new_leaf(taffy::style::Style {
248            box_sizing: taffy::style::BoxSizing::ContentBox,
249            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
250            ..Default::default()
251        })
252        .unwrap();
253    let node1 = taffy
254        .new_with_children(
255            taffy::style::Style {
256                box_sizing: taffy::style::BoxSizing::ContentBox,
257                size: taffy::geometry::Size {
258                    width: taffy::style::Dimension::from_length(20f32),
259                    height: taffy::style::Dimension::from_length(20f32),
260                },
261                ..Default::default()
262            },
263            &[node10],
264        )
265        .unwrap();
266    let node20 = taffy
267        .new_leaf(taffy::style::Style {
268            box_sizing: taffy::style::BoxSizing::ContentBox,
269            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
270            ..Default::default()
271        })
272        .unwrap();
273    let node2 = taffy
274        .new_with_children(
275            taffy::style::Style {
276                box_sizing: taffy::style::BoxSizing::ContentBox,
277                size: taffy::geometry::Size {
278                    width: taffy::style::Dimension::from_length(20f32),
279                    height: taffy::style::Dimension::from_length(20f32),
280                },
281                ..Default::default()
282            },
283            &[node20],
284        )
285        .unwrap();
286    let node3 = taffy
287        .new_leaf(taffy::style::Style {
288            box_sizing: taffy::style::BoxSizing::ContentBox,
289            size: taffy::geometry::Size {
290                width: taffy::style::Dimension::from_length(20f32),
291                height: taffy::style::Dimension::from_length(20f32),
292            },
293            ..Default::default()
294        })
295        .unwrap();
296    let node4 = taffy
297        .new_leaf(taffy::style::Style {
298            box_sizing: taffy::style::BoxSizing::ContentBox,
299            size: taffy::geometry::Size {
300                width: taffy::style::Dimension::from_length(20f32),
301                height: taffy::style::Dimension::from_length(20f32),
302            },
303            ..Default::default()
304        })
305        .unwrap();
306    let node5 = taffy
307        .new_leaf(taffy::style::Style {
308            box_sizing: taffy::style::BoxSizing::ContentBox,
309            size: taffy::geometry::Size {
310                width: taffy::style::Dimension::from_length(20f32),
311                height: taffy::style::Dimension::from_length(20f32),
312            },
313            ..Default::default()
314        })
315        .unwrap();
316    let node60 = taffy
317        .new_leaf(taffy::style::Style {
318            box_sizing: taffy::style::BoxSizing::ContentBox,
319            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(10f32) },
320            ..Default::default()
321        })
322        .unwrap();
323    let node6 = taffy
324        .new_with_children(
325            taffy::style::Style {
326                box_sizing: taffy::style::BoxSizing::ContentBox,
327                size: taffy::geometry::Size {
328                    width: taffy::style::Dimension::from_length(20f32),
329                    height: taffy::style::Dimension::from_length(20f32),
330                },
331                ..Default::default()
332            },
333            &[node60],
334        )
335        .unwrap();
336    let node70 = taffy
337        .new_leaf(taffy::style::Style {
338            box_sizing: taffy::style::BoxSizing::ContentBox,
339            size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::from_length(5f32) },
340            ..Default::default()
341        })
342        .unwrap();
343    let node7 = taffy
344        .new_with_children(
345            taffy::style::Style {
346                box_sizing: taffy::style::BoxSizing::ContentBox,
347                size: taffy::geometry::Size {
348                    width: taffy::style::Dimension::from_length(20f32),
349                    height: taffy::style::Dimension::from_length(20f32),
350                },
351                ..Default::default()
352            },
353            &[node70],
354        )
355        .unwrap();
356    let node8 = taffy
357        .new_leaf(taffy::style::Style {
358            box_sizing: taffy::style::BoxSizing::ContentBox,
359            size: taffy::geometry::Size {
360                width: taffy::style::Dimension::from_length(20f32),
361                height: taffy::style::Dimension::from_length(20f32),
362            },
363            ..Default::default()
364        })
365        .unwrap();
366    let node = taffy
367        .new_with_children(
368            taffy::style::Style {
369                display: taffy::style::Display::Grid,
370                box_sizing: taffy::style::BoxSizing::ContentBox,
371                align_items: Some(taffy::style::AlignItems::Baseline),
372                grid_template_rows: vec![length(40f32), length(40f32), length(40f32)],
373                grid_template_columns: vec![length(40f32), length(40f32), length(40f32)],
374                size: taffy::geometry::Size {
375                    width: taffy::style::Dimension::from_length(120f32),
376                    height: taffy::style::Dimension::from_length(120f32),
377                },
378                ..Default::default()
379            },
380            &[node0, node1, node2, node3, node4, node5, node6, node7, node8],
381        )
382        .unwrap();
383    taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
384    println!("\nComputed tree:");
385    taffy.print_tree(node);
386    println!();
387    let layout = taffy.layout(node).unwrap();
388    let Layout { size, location, .. } = layout;
389    assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node, 120f32, size.width);
390    assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node, 120f32, size.height);
391    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
392    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
393    let layout = taffy.layout(node0).unwrap();
394    let Layout { size, location, .. } = layout;
395    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node0, 20f32, size.width);
396    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node0, 20f32, size.height);
397    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
398    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
399    let layout = taffy.layout(node1).unwrap();
400    let Layout { size, location, .. } = layout;
401    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node1, 20f32, size.width);
402    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node1, 20f32, size.height);
403    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node1, 40f32, location.x);
404    assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1, 10f32, location.y);
405    let layout = taffy.layout(node10).unwrap();
406    let Layout { size, location, .. } = layout;
407    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node10, 0f32, size.width);
408    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node10, 10f32, size.height);
409    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node10, 0f32, location.x);
410    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node10, 0f32, location.y);
411    let layout = taffy.layout(node2).unwrap();
412    let Layout { size, location, .. } = layout;
413    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node2, 20f32, size.width);
414    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node2, 20f32, size.height);
415    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node2, 80f32, location.x);
416    assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node2, 10f32, location.y);
417    let layout = taffy.layout(node20).unwrap();
418    let Layout { size, location, .. } = layout;
419    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node20, 0f32, size.width);
420    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node20, 10f32, size.height);
421    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node20, 0f32, location.x);
422    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node20, 0f32, location.y);
423    let layout = taffy.layout(node3).unwrap();
424    let Layout { size, location, .. } = layout;
425    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node3, 20f32, size.width);
426    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node3, 20f32, size.height);
427    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node3, 0f32, location.x);
428    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node3, 40f32, location.y);
429    let layout = taffy.layout(node4).unwrap();
430    let Layout { size, location, .. } = layout;
431    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node4, 20f32, size.width);
432    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node4, 20f32, size.height);
433    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node4, 40f32, location.x);
434    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node4, 40f32, location.y);
435    let layout = taffy.layout(node5).unwrap();
436    let Layout { size, location, .. } = layout;
437    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node5, 20f32, size.width);
438    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node5, 20f32, size.height);
439    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node5, 80f32, location.x);
440    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node5, 40f32, location.y);
441    let layout = taffy.layout(node6).unwrap();
442    let Layout { size, location, .. } = layout;
443    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node6, 20f32, size.width);
444    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node6, 20f32, size.height);
445    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node6, 0f32, location.x);
446    assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node6, 90f32, location.y);
447    let layout = taffy.layout(node60).unwrap();
448    let Layout { size, location, .. } = layout;
449    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node60, 0f32, size.width);
450    assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node60, 10f32, size.height);
451    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node60, 0f32, location.x);
452    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node60, 0f32, location.y);
453    let layout = taffy.layout(node7).unwrap();
454    let Layout { size, location, .. } = layout;
455    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node7, 20f32, size.width);
456    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node7, 20f32, size.height);
457    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node7, 40f32, location.x);
458    assert_eq!(location.y, 95f32, "y of node {:?}. Expected {}. Actual {}", node7, 95f32, location.y);
459    let layout = taffy.layout(node70).unwrap();
460    let Layout { size, location, .. } = layout;
461    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node70, 0f32, size.width);
462    assert_eq!(size.height, 5f32, "height of node {:?}. Expected {}. Actual {}", node70, 5f32, size.height);
463    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node70, 0f32, location.x);
464    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node70, 0f32, location.y);
465    let layout = taffy.layout(node8).unwrap();
466    let Layout { size, location, .. } = layout;
467    assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node8, 20f32, size.width);
468    assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node8, 20f32, size.height);
469    assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node8, 80f32, location.x);
470    assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node8, 80f32, location.y);
471}