1#[test]
2fn border_no_child() {
3 let mut taffy = taffy::Taffy::new();
4 let node = taffy
5 .new_node(
6 taffy::style::Style {
7 border: taffy::geometry::Rect {
8 start: taffy::style::Dimension::Points(10f32),
9 end: taffy::style::Dimension::Points(10f32),
10 top: taffy::style::Dimension::Points(10f32),
11 bottom: taffy::style::Dimension::Points(10f32),
12 ..Default::default()
13 },
14 ..Default::default()
15 },
16 &[],
17 )
18 .unwrap();
19 taffy.compute_layout(node, taffy::geometry::Size::undefined()).unwrap();
20 assert_eq!(taffy.layout(node).unwrap().size.width, 20f32);
21 assert_eq!(taffy.layout(node).unwrap().size.height, 20f32);
22 assert_eq!(taffy.layout(node).unwrap().location.x, 0f32);
23 assert_eq!(taffy.layout(node).unwrap().location.y, 0f32);
24}