1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/expr"#]
2// Copyright © SixtyFPS GmbH <info@slint.dev>
3// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
4
5 TestCase := Rectangle {
6 property<float> t1: pow(4.0, 2);
7 property<float> t2: pow(9, 3.0);
8}
9/*
10```cpp
11auto handle = TestCase::create();
12const TestCase &instance = *handle;
13assert_eq(instance.get_t1(), 16.0);
14assert_eq(instance.get_t2(), 729.0);
15```
16
17```rust
18let instance = TestCase::new().unwrap();
19assert_eq!(instance.get_t1(), 16.0);
20assert_eq!(instance.get_t2(), 729.0);
21```
22
23```js
24var instance = new slint.TestCase({});
25assert.equal(instance.t1, 16);
26assert.equal(instance.t2, 729);
27```
28*/
29}
30
31#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
32 use i_slint_backend_testing as slint_testing;
33 slint_testing::init();
34 let instance = TestCase::new().unwrap();
35 assert_eq!(instance.get_t1(), 16.0);
36 assert_eq!(instance.get_t2(), 729.0);
37 Ok(())
38}