1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/bindings"# ] |
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 | |
6 | TestCase := Rectangle { |
7 | width: 100px; |
8 | height: 200px; |
9 | |
10 | r := Rectangle { |
11 | width <=> root.width; |
12 | height <=> root.height; |
13 | } |
14 | |
15 | property<bool> test: r.width == 100px && r.height == 200px; |
16 | } |
17 | |
18 | /* |
19 | ```rust |
20 | let instance = TestCase::new().unwrap(); |
21 | assert!(instance.get_test()); |
22 | ``` |
23 | |
24 | ```cpp |
25 | auto handle = TestCase::create(); |
26 | const TestCase &instance = *handle; |
27 | assert(instance.get_test()); |
28 | ``` |
29 | |
30 | ```js |
31 | let instance = new slint.TestCase({}); |
32 | assert(instance.test, 1); |
33 | ``` |
34 | |
35 | */ |
36 | } |
37 | |
38 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
39 | use i_slint_backend_testing as slint_testing; |
40 | slint_testing::init(); |
41 | let instance = TestCase::new().unwrap(); |
42 | assert!(instance.get_test()); |
43 | Ok(()) |
44 | } |