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 |
21 | auto handle = Test_Case::create(); |
22 | const Test_Case &instance = *handle; |
23 | assert_eq(instance.get_property_x1(), 42); |
24 | assert_eq(instance.get_property_x2(), 42); |
25 | assert_eq(instance.get_this__has_6_slashes__(), 86); |
26 | ``` |
27 | |
28 | ```rust |
29 | let instance = Test_Case::new().unwrap(); |
30 | assert_eq!(instance.get_property_x1(), 42.); |
31 | assert_eq!(instance.get_property_x2(), 42.); |
32 | assert_eq!(instance.get_this__has_6_slashes__(), 86); |
33 | ``` |
34 | |
35 | ```js |
36 | var instance = new slint.Test_Case({}); |
37 | assert.equal(instance.property_x1, 42); |
38 | assert.equal(instance.property_x2, 42); |
39 | assert.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 | } |