gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81414 Definitions

⎇ ac3349ce0fd60591d6019a4658dfe84912514e62 tests/generated/wrap_reverse_row_align_content_space_around.rs Rust · 85 lines · 3.6 KB History Who touched what raw

[gentest] Split generated tests into separate files. ac3349ce0 · Adam Perry ·

1#[test]
2fn wrap_reverse_row_align_content_space_around() {
3    let layout = stretch::compute(
4        &stretch::style::Node {
5            flex_wrap: stretch::style::FlexWrap::WrapReverse,
6            align_content: stretch::style::AlignContent::SpaceAround,
7            size: stretch::geometry::Size { width: stretch::style::Dimension::Points(100.0000), ..Default::default() },
8            children: vec![
9                stretch::style::Node {
10                    size: stretch::geometry::Size {
11                        width: stretch::style::Dimension::Points(30.0000),
12                        height: stretch::style::Dimension::Points(10.0000),
13                        ..Default::default()
14                    },
15                    ..Default::default()
16                },
17                stretch::style::Node {
18                    size: stretch::geometry::Size {
19                        width: stretch::style::Dimension::Points(30.0000),
20                        height: stretch::style::Dimension::Points(20.0000),
21                        ..Default::default()
22                    },
23                    ..Default::default()
24                },
25                stretch::style::Node {
26                    size: stretch::geometry::Size {
27                        width: stretch::style::Dimension::Points(30.0000),
28                        height: stretch::style::Dimension::Points(30.0000),
29                        ..Default::default()
30                    },
31                    ..Default::default()
32                },
33                stretch::style::Node {
34                    size: stretch::geometry::Size {
35                        width: stretch::style::Dimension::Points(30.0000),
36                        height: stretch::style::Dimension::Points(40.0000),
37                        ..Default::default()
38                    },
39                    ..Default::default()
40                },
41                stretch::style::Node {
42                    size: stretch::geometry::Size {
43                        width: stretch::style::Dimension::Points(30.0000),
44                        height: stretch::style::Dimension::Points(50.0000),
45                        ..Default::default()
46                    },
47                    ..Default::default()
48                },
49            ],
50            ..Default::default()
51        },
52        stretch::geometry::Size::undefined(),
53    )
54    .unwrap();
55
56    assert_eq!(layout.size.width, 100.0000);
57    assert_eq!(layout.size.height, 80.0000);
58    assert_eq!(layout.location.x, 0.0000);
59    assert_eq!(layout.location.y, 0.0000);
60
61    assert_eq!(layout.children[0].size.width, 30.0000);
62    assert_eq!(layout.children[0].size.height, 10.0000);
63    assert_eq!(layout.children[0].location.x, 0.0000);
64    assert_eq!(layout.children[0].location.y, 70.0000);
65
66    assert_eq!(layout.children[1].size.width, 30.0000);
67    assert_eq!(layout.children[1].size.height, 20.0000);
68    assert_eq!(layout.children[1].location.x, 30.0000);
69    assert_eq!(layout.children[1].location.y, 60.0000);
70
71    assert_eq!(layout.children[2].size.width, 30.0000);
72    assert_eq!(layout.children[2].size.height, 30.0000);
73    assert_eq!(layout.children[2].location.x, 60.0000);
74    assert_eq!(layout.children[2].location.y, 50.0000);
75
76    assert_eq!(layout.children[3].size.width, 30.0000);
77    assert_eq!(layout.children[3].size.height, 40.0000);
78    assert_eq!(layout.children[3].location.x, 0.0000);
79    assert_eq!(layout.children[3].location.y, 10.0000);
80
81    assert_eq!(layout.children[4].size.width, 30.0000);
82    assert_eq!(layout.children[4].size.height, 50.0000);
83    assert_eq!(layout.children[4].location.x, 30.0000);
84    assert_eq!(layout.children[4].location.y, 0.0000);
85}