1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/bindings"#]
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
5LineEdit := Rectangle {
6 property <string> text <=> ti.text;
7 ti := TextInput { }
8}
9
10LiTest := Rectangle {
11 li1 := LineEdit { text: "li1"; }
12 li2 := LineEdit { text <=> li1.text; }
13 li3 := LineEdit { text <=> li4.text; }
14 li4 := LineEdit { text: "li4"; }
15 property <bool> test_li: li1.text == "li1" && li3.text == "li4";
16}
17
18export TestCase := Window {
19
20 li := LiTest { }
21
22 property <bool> test: li.test_li;
23}
24
25/*
26
27```rust
28let instance = TestCase::new().unwrap();
29assert!(instance.get_test());
30```
31
32
33
34```cpp
35auto handle = TestCase::create();
36const TestCase &instance = *handle;
37assert(instance.get_test());
38```
39
40
41```js
42let instance = new slint.TestCase({});
43assert(instance.test);
44```
45
46*/
47}
48
49#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
50 use i_slint_backend_testing as slint_testing;
51 slint_testing::init();
52 let instance = TestCase::new().unwrap();
53 assert!(instance.get_test());
54 Ok(())
55}