| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | |
| 5 | TestCase := Rectangle { |
| 6 | width: 100px; |
| 7 | height: 200px; |
| 8 | |
| 9 | r := Rectangle { |
| 10 | width <=> root.width; |
| 11 | height <=> root.height; |
| 12 | } |
| 13 | |
| 14 | property<bool> test: r.width == 100px && r.height == 200px; |
| 15 | } |
| 16 | |
| 17 | /* |
| 18 | ```rust |
| 19 | let instance = TestCase::new().unwrap(); |
| 20 | assert!(instance.get_test()); |
| 21 | ``` |
| 22 | |
| 23 | ```cpp |
| 24 | auto handle = TestCase::create(); |
| 25 | const TestCase &instance = *handle; |
| 26 | assert(instance.get_test()); |
| 27 | ``` |
| 28 | |
| 29 | ```js |
| 30 | let instance = new slint.TestCase({}); |
| 31 | assert(instance.test, 1); |
| 32 | ``` |
| 33 | |
| 34 | */ |
| 35 | |