1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/exports/../../helper_components"# ] |
2 | #[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/exports"# ] |
3 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
4 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
5 | |
6 | //include_path: ../../helper_components |
7 | import { ExportedStruct, ExportEnum } from "export_structs.slint" ; |
8 | export { ExportedStruct as NamedStruct, ExportEnum as NamedEnum } |
9 | component TestCase inherits Rectangle { |
10 | in-out property<ExportedStruct> st; |
11 | in-out property<ExportEnum> en: ExportEnum.Bonjour; |
12 | } |
13 | export { TestCase as NamedTestCase } |
14 | |
15 | /* |
16 | |
17 | ```cpp |
18 | auto handle = NamedTestCase::create(); |
19 | const TestCase &instance = *handle; |
20 | assert(instance.get_en() == NamedEnum::Bonjour); |
21 | ``` |
22 | |
23 | ```rust |
24 | let instance = NamedTestCase::new().unwrap(); |
25 | assert_eq!(instance.get_en(), NamedEnum::Bonjour); |
26 | ``` |
27 | |
28 | */ |
29 | } |
30 | |
31 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
32 | use i_slint_backend_testing as slint_testing; |
33 | slint_testing::init(); |
34 | let instance = NamedTestCase::new().unwrap(); |
35 | assert_eq!(instance.get_en(), NamedEnum::Bonjour); |
36 | Ok(()) |
37 | } |