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