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
7import { UseGlobal } from "export_globals.slint";
8TestCase := Rectangle {
9 ug := UseGlobal {}
10 property<int> p1: ug.used42;
11 property<int> p2: ug.used44;
12}
13/*
14
15```cpp
16auto handle = TestCase::create();
17const TestCase &instance = *handle;
18assert_eq(instance.get_p1(), 42);
19assert_eq(instance.get_p2(), 44);
20```
21
22```rust
23let instance = TestCase::new().unwrap();
24assert_eq!(instance.get_p1(), 42);
25assert_eq!(instance.get_p2(), 44);
26```
27
28```js
29var instance = new slint.TestCase({});
30assert.equal(instance.p1, 42);
31assert.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}