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 | |
5 | LineEdit := Rectangle { |
6 | property <string> text <=> ti.text; |
7 | ti := TextInput { } |
8 | } |
9 | |
10 | LiTest := 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 | |
18 | export TestCase := Window { |
19 | |
20 | li := LiTest { } |
21 | |
22 | property <bool> test: li.test_li; |
23 | } |
24 | |
25 | /* |
26 | |
27 | ```rust |
28 | let instance = TestCase::new().unwrap(); |
29 | assert!(instance.get_test()); |
30 | ``` |
31 | |
32 | |
33 | |
34 | ```cpp |
35 | auto handle = TestCase::create(); |
36 | const TestCase &instance = *handle; |
37 | assert(instance.get_test()); |
38 | ``` |
39 | |
40 | |
41 | ```js |
42 | let instance = new slint.TestCase({}); |
43 | assert(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 | } |