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 TestCase := Rectangle {
5 property<float> t1: sqrt(100.0);
6 property<float> t2: sqrt(2);
7}
8/*
9```cpp
10auto handle = TestCase::create();
11const TestCase &instance = *handle;
12assert_eq(instance.get_t1(), 10.0);
13assert(std::abs(instance.get_t2() - 1.414214) < 0.0001);
14```
15
16```rust
17let instance = TestCase::new().unwrap();
18assert_eq!(instance.get_t1(), 10.0);
19assert!((instance.get_t2() - 1.414214).abs() < 0.0001);
20```
21
22```js
23var instance = new slint.TestCase({});
24assert.equal(instance.t1, 10);
25assert(Math.abs(instance.t2 - 1.414214) < 0.0001);
26```
27*/
28