1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/children"# ] |
2 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
3 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
4 | |
5 | Container := Rectangle { |
6 | GridLayout { |
7 | padding: 0phx; |
8 | spacing: 0phx; |
9 | Row { |
10 | Rectangle { |
11 | background: green; |
12 | } |
13 | @children |
14 | } |
15 | } |
16 | } |
17 | |
18 | TestCase := Container { |
19 | width: 300phx; |
20 | height: 200phx; |
21 | |
22 | rect1 := Rectangle { |
23 | background: black; |
24 | } |
25 | |
26 | |
27 | property <bool> rect1_pos_ok: rect1.x == 150phx; |
28 | } |
29 | /* |
30 | ```cpp |
31 | auto handle = TestCase::create(); |
32 | const TestCase &instance = *handle; |
33 | assert(instance.get_rect1_pos_ok()); |
34 | ``` |
35 | |
36 | |
37 | ```rust |
38 | let instance = TestCase::new().unwrap(); |
39 | assert!(instance.get_rect1_pos_ok()); |
40 | ``` |
41 | */ |
42 | } |
43 | |
44 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
45 | use i_slint_backend_testing as slint_testing; |
46 | slint_testing::init(); |
47 | let instance = TestCase::new().unwrap(); |
48 | assert!(instance.get_rect1_pos_ok()); |
49 | Ok(()) |
50 | } |