1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/properties"#]
2// Copyright © SixtyFPS GmbH <info@slint.dev>
3// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
4
5 Test-Case := Rectangle {
6
7 property<length> property-x1: xxx-foo.border-width;
8 property<length> property-x2: xxx_foo.border_width;
9
10 xxx-foo := Rectangle {
11 border-width: 42phx;
12 }
13
14 property<int> hello-42: 42;
15 property<int> hello--world: -hello-42 - 2; // -42 - 2 = -44
16 property<int> this--has-6-slashes--: 42-hello--world; // 42 - -44 = 86
17
18}
19/*
20```cpp
21auto handle = Test_Case::create();
22const Test_Case &instance = *handle;
23assert_eq(instance.get_property_x1(), 42);
24assert_eq(instance.get_property_x2(), 42);
25assert_eq(instance.get_this__has_6_slashes__(), 86);
26```
27
28```rust
29let instance = Test_Case::new().unwrap();
30assert_eq!(instance.get_property_x1(), 42.);
31assert_eq!(instance.get_property_x2(), 42.);
32assert_eq!(instance.get_this__has_6_slashes__(), 86);
33```
34
35```js
36var instance = new slint.Test_Case({});
37assert.equal(instance.property_x1, 42);
38assert.equal(instance.property_x2, 42);
39assert.equal(instance.this__has_6_slashes__, 86);
40```
41*/
42}
43
44#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
45 use i_slint_backend_testing as slint_testing;
46 slint_testing::init();
47 let instance = Test_Case::new().unwrap();
48 assert_eq!(instance.get_property_x1(), 42.);
49 assert_eq!(instance.get_property_x2(), 42.);
50 assert_eq!(instance.get_this__has_6_slashes__(), 86);
51 Ok(())
52}