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, ExportedGlobal as FromExport } from "export_globals.slint";
8
9global NotExported := {
10 property<int> abc: 1000;
11 property<string> prop: "_";
12}
13
14global ExportedGlobal := {
15 property<int> abc: 1001;
16}
17
18TestCase := Rectangle {
19 ug := UseGlobal {}
20 property<int> p1: ug.used42;
21 property<int> p2: ug.used44;
22 property<int> p3: NotExported.abc + ExportedGlobal.abc;
23
24 property <bool> test: p1 == 42 && p2 == 44 && p3 == 2001 ;//&& NotExported.prop == "_";
25}
26/*
27
28```cpp
29auto handle = TestCase::create();
30const TestCase &instance = *handle;
31assert_eq(instance.get_p1(), 42);
32assert_eq(instance.get_p2(), 44);
33assert_eq(instance.get_p3(), 2001);
34```
35
36```rust
37let instance = TestCase::new().unwrap();
38assert_eq!(instance.get_p1(), 42);
39assert_eq!(instance.get_p2(), 44);
40assert_eq!(instance.get_p3(), 2001);
41```
42
43```js
44var instance = new slint.TestCase({});
45assert.equal(instance.p1, 42);
46assert.equal(instance.p2, 44);
47assert.equal(instance.p3, 2001);
48```
49
50*/
51}
52
53#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
54 use i_slint_backend_testing as slint_testing;
55 slint_testing::init();
56 let instance = TestCase::new().unwrap();
57 assert_eq!(instance.get_p1(), 42);
58 assert_eq!(instance.get_p2(), 44);
59 assert_eq!(instance.get_p3(), 2001);
60 Ok(())
61}