slint/tests/cases/expr/pow.slint
2023-02-10 05:00:03 +01:00

27 lines
626 B
Text

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
property<float> t1: pow(4.0, 2);
property<float> t2: pow(9, 3.0);
}
/*
```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
assert_eq(instance.get_t1(), 16.0);
assert_eq(instance.get_t2(), 729.0);
```
```rust
let instance = TestCase::new().unwrap();
assert_eq!(instance.get_t1(), 16.0);
assert_eq!(instance.get_t2(), 729.0);
```
```js
var instance = new slint.TestCase({});
assert.equal(instance.t1, 16);
assert.equal(instance.t2, 729);
```
*/