1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
3 | |
4 | Test-Case := Rectangle { |
5 | |
6 | property<length> property-x1: xxx-foo.border-width; |
7 | property<length> property-x2: xxx_foo.border_width; |
8 | |
9 | xxx-foo := Rectangle { |
10 | border-width: 42phx; |
11 | } |
12 | |
13 | property<int> hello-42: 42; |
14 | property<int> hello--world: -hello-42 - 2; // -42 - 2 = -44 |
15 | property<int> this--has-6-slashes--: 42-hello--world; // 42 - -44 = 86 |
16 | |
17 | } |
18 | /* |
19 | ```cpp |
20 | auto handle = Test_Case::create(); |
21 | const Test_Case &instance = *handle; |
22 | assert_eq(instance.get_property_x1(), 42); |
23 | assert_eq(instance.get_property_x2(), 42); |
24 | assert_eq(instance.get_this__has_6_slashes__(), 86); |
25 | ``` |
26 | |
27 | ```rust |
28 | let instance = Test_Case::new().unwrap(); |
29 | assert_eq!(instance.get_property_x1(), 42.); |
30 | assert_eq!(instance.get_property_x2(), 42.); |
31 | assert_eq!(instance.get_this__has_6_slashes__(), 86); |
32 | ``` |
33 | |
34 | ```js |
35 | var instance = new slint.Test_Case({}); |
36 | assert.equal(instance.property_x1, 42); |
37 | assert.equal(instance.property_x2, 42); |
38 | assert.equal(instance.this__has_6_slashes__, 86); |
39 | ``` |
40 | */ |
41 | |