⎇ 54e00d63d6d4a99e89ac0934a6bb61e415ab1006
tests/generated/size_defined_by_child_with_padding.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
update tests and benchmarks to use new api
1#[test]
2fn size_defined_by_child_with_padding() {
3 let layout = stretch::node::Node::new(
4 stretch::style::Style {
5 padding: stretch::geometry::Rect {
6 start: stretch::style::Dimension::Points(10f32),
7 end: stretch::style::Dimension::Points(10f32),
8 top: stretch::style::Dimension::Points(10f32),
9 bottom: stretch::style::Dimension::Points(10f32),
10 ..Default::default()
11 },
12 ..Default::default()
13 },
14 vec![&stretch::node::Node::new(
15 stretch::style::Style {
16 size: stretch::geometry::Size {
17 width: stretch::style::Dimension::Points(10f32),
18 height: stretch::style::Dimension::Points(10f32),
19 ..Default::default()
20 },
21 ..Default::default()
22 },
23 vec![],
24 )],
25 )
26 .compute_layout(stretch::geometry::Size::undefined())
27 .unwrap();
28 assert_eq!(layout.size.width, 30f32);
29 assert_eq!(layout.size.height, 30f32);
30 assert_eq!(layout.location.x, 0f32);
31 assert_eq!(layout.location.y, 0f32);
32 assert_eq!(layout.children[0usize].size.width, 10f32);
33 assert_eq!(layout.children[0usize].size.height, 10f32);
34 assert_eq!(layout.children[0usize].location.x, 10f32);
35 assert_eq!(layout.children[0usize].location.y, 10f32);
36}