1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
4//include_path: ../../helper_components
5import {
6 UseGlobal,
7 ExportedGlobal as FromExport,
8} from "export_globals.slint";
9
10global NotExported := {
11 property<int> abc: 1000;
12 property<string> prop: "_";
13}
14
15global ExportedGlobal := {
16 property<int> abc: 1001;
17}
18
19TestCase := Rectangle {
20 ug := UseGlobal {}
21 property<int> p1: ug.used42;
22 property<int> p2: ug.used44;
23 property<int> p3: NotExported.abc + ExportedGlobal.abc;
24
25 property <bool> test: p1 == 42 && p2 == 44 && p3 == 2001 ;//&& NotExported.prop == "_";
26}
27/*
28
29```cpp
30auto handle = TestCase::create();
31const TestCase &instance = *handle;
32assert_eq(instance.get_p1(), 42);
33assert_eq(instance.get_p2(), 44);
34assert_eq(instance.get_p3(), 2001);
35```
36
37```rust
38let instance = TestCase::new().unwrap();
39assert_eq!(instance.get_p1(), 42);
40assert_eq!(instance.get_p2(), 44);
41assert_eq!(instance.get_p3(), 2001);
42```
43
44```js
45var instance = new slint.TestCase({});
46assert.equal(instance.p1, 42);
47assert.equal(instance.p2, 44);
48assert.equal(instance.p3, 2001);
49```
50
51*/
52