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 | TestCase := Rectangle { |
5 | property<int> t1: ceil(42.2); |
6 | property<int> t2: ceil(23.5); |
7 | property<int> t3: ceil(24.6); |
8 | property<int> t4: ceil(25); |
9 | |
10 | property<int> n1: ceil(-42.2); |
11 | property<int> n2: ceil(-23.5); |
12 | property<int> n3: ceil(-24.6); |
13 | property<int> n4: ceil(-25); |
14 | } |
15 | /* |
16 | ```cpp |
17 | auto handle = TestCase::create(); |
18 | const TestCase &instance = *handle; |
19 | assert_eq(instance.get_t1(), 43); |
20 | assert_eq(instance.get_t2(), 24); |
21 | assert_eq(instance.get_t3(), 25); |
22 | assert_eq(instance.get_t4(), 25); |
23 | assert_eq(instance.get_n1(), -42); |
24 | assert_eq(instance.get_n2(), -23); |
25 | assert_eq(instance.get_n3(), -24); |
26 | assert_eq(instance.get_n4(), -25); |
27 | ``` |
28 | |
29 | ```rust |
30 | let instance = TestCase::new().unwrap(); |
31 | assert_eq!(instance.get_t1(), 43); |
32 | assert_eq!(instance.get_t2(), 24); |
33 | assert_eq!(instance.get_t3(), 25); |
34 | assert_eq!(instance.get_t4(), 25); |
35 | assert_eq!(instance.get_n1(), -42); |
36 | assert_eq!(instance.get_n2(), -23); |
37 | assert_eq!(instance.get_n3(), -24); |
38 | assert_eq!(instance.get_n4(), -25); |
39 | ``` |
40 | |
41 | ```js |
42 | var instance = new slint.TestCase({}); |
43 | assert.equal(instance.t1, 43); |
44 | assert.equal(instance.t2, 24); |
45 | assert.equal(instance.t3, 25); |
46 | assert.equal(instance.t4, 25); |
47 | assert.equal(instance.n1, -42); |
48 | assert.equal(instance.n2, -23); |
49 | assert.equal(instance.n3, -24); |
50 | assert.equal(instance.n4, -25); |
51 | ``` |
52 | */ |
53 | |