⎇ b952c2b38dc58e87f43dc263e17beb4174bc68e2
tests/generated/justify_content_row_min_width_and_margin.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
Rename Rect field start->left end->right (#257)
1#[test]
2fn justify_content_row_min_width_and_margin() {
3 let mut taffy = taffy::Taffy::new();
4 let node0 = taffy
5 .new_with_children(
6 taffy::style::Style {
7 size: taffy::geometry::Size {
8 width: taffy::style::Dimension::Points(20f32),
9 height: taffy::style::Dimension::Points(20f32),
10 ..Default::default()
11 },
12 margin: taffy::geometry::Rect { left: taffy::style::Dimension::Points(10f32), ..Default::default() },
13 ..Default::default()
14 },
15 &[],
16 )
17 .unwrap();
18 let node = taffy
19 .new_with_children(
20 taffy::style::Style {
21 justify_content: taffy::style::JustifyContent::Center,
22 min_size: taffy::geometry::Size { width: taffy::style::Dimension::Points(50f32), ..Default::default() },
23 ..Default::default()
24 },
25 &[node0],
26 )
27 .unwrap();
28 taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
29 assert_eq!(taffy.layout(node).unwrap().size.width, 50f32);
30 assert_eq!(taffy.layout(node).unwrap().size.height, 20f32);
31 assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
32 assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
33 assert_eq!(taffy.layout(node0).unwrap().size.width, 20f32);
34 assert_eq!(taffy.layout(node0).unwrap().size.height, 20f32);
35 assert_eq!(taffy.layout(node0).unwrap().location.x, 20f32);
36 assert_eq!(taffy.layout(node0).unwrap().location.y, 0f32);
37}