mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
38 lines
1,021 B
Text
38 lines
1,021 B
Text
/* LICENSE BEGIN
|
|
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
|
Copyright (c) 2021 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
|
Copyright (c) 2021 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
|
|
|
SPDX-License-Identifier: GPL-3.0-only
|
|
This file is also available under commercial licensing terms.
|
|
Please contact info@sixtyfps.io for more information.
|
|
LICENSE END */
|
|
TestCase := Rectangle {
|
|
property<int> t1: mod(42, 2);
|
|
property<float> t2: mod(8.3, 10);
|
|
property<int> t3: mod(153, 10);
|
|
}
|
|
/*
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
assert_eq(instance.get_t1(), 0);
|
|
assert_eq(instance.get_t2(), 8.0);
|
|
assert_eq(instance.get_t3(),3);
|
|
```
|
|
|
|
|
|
```rust
|
|
let instance = TestCase::new();
|
|
assert_eq!(instance.get_t1(), 0);
|
|
assert_eq!(instance.get_t2(), 8.0);
|
|
assert_eq!(instance.get_t3(), 3);
|
|
```
|
|
|
|
```js
|
|
var instance = new sixtyfps.TestCase({});
|
|
assert.equal(instance.t1, 0);
|
|
assert.equal(instance.t2, 8.0);
|
|
assert.equal(instance.t3, 3);
|
|
```
|
|
*/
|