1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/imports/../../helper_components"# ] |
2 | #[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/imports"# ] |
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 { UseGlobal } from "export_globals.slint" ; |
8 | TestCase := Rectangle { |
9 | ug := UseGlobal {} |
10 | property<int> p1: ug.used42; |
11 | property<int> p2: ug.used44; |
12 | } |
13 | /* |
14 | |
15 | ```cpp |
16 | auto handle = TestCase::create(); |
17 | const TestCase &instance = *handle; |
18 | assert_eq(instance.get_p1(), 42); |
19 | assert_eq(instance.get_p2(), 44); |
20 | ``` |
21 | |
22 | ```rust |
23 | let instance = TestCase::new().unwrap(); |
24 | assert_eq!(instance.get_p1(), 42); |
25 | assert_eq!(instance.get_p2(), 44); |
26 | ``` |
27 | |
28 | ```js |
29 | var instance = new slint.TestCase({}); |
30 | assert.equal(instance.p1, 42); |
31 | assert.equal(instance.p2, 44); |
32 | ``` |
33 | |
34 | */ |
35 | } |
36 | |
37 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
38 | use i_slint_backend_testing as slint_testing; |
39 | slint_testing::init(); |
40 | let instance = TestCase::new().unwrap(); |
41 | assert_eq!(instance.get_p1(), 42); |
42 | assert_eq!(instance.get_p2(), 44); |
43 | Ok(()) |
44 | } |