/* LICENSE BEGIN This file is part of the SixtyFPS Project -- https://sixtyfps.io Copyright (c) 2021 Olivier Goffart Copyright (c) 2021 Simon Hausmann 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 { width: 100phx; height: 100phx; background: white; property top_level: 42; property cond1; property cond2; property cond3; if (cond1) : TouchArea { width: parent.width; height: root.height; property xx: root.top_level; clicked => { root.top_level += self.xx + 8; } } if (cond1 ? cond2 : cond3) : Rectangle { background: root.background; } } /* ```cpp auto handle = TestCase::create(); const TestCase &instance = *handle; // condition is false sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq(instance.get_top_level(), 42); instance.set_cond1(true); sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq(instance.get_top_level(), 92); instance.set_cond1(false); sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq(instance.get_top_level(), 92); ``` ```rust let instance = TestCase::new(); sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq!(instance.get_top_level(), 42); instance.set_cond1(true); sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq!(instance.get_top_level(), 92); instance.set_cond1(false); sixtyfps::testing::send_mouse_click(&instance, 5., 5.); assert_eq!(instance.get_top_level(), 92); ``` ```js var instance = new sixtyfps.TestCase(); instance.send_mouse_click(5., 5.); assert.equal(instance.top_level, 42); instance.cond1 = true; instance.send_mouse_click(5., 5.); assert.equal(instance.top_level, 92); instance.cond1 = false; instance.send_mouse_click(5., 5.); assert.equal(instance.top_level, 92); ``` */