diff --git a/osu.Framework.Tests/Visual/Input/TestScenePassThroughInputManager.cs b/osu.Framework.Tests/Visual/Input/TestScenePassThroughInputManager.cs index 7de2f5014d..3906690f42 100644 --- a/osu.Framework.Tests/Visual/Input/TestScenePassThroughInputManager.cs +++ b/osu.Framework.Tests/Visual/Input/TestScenePassThroughInputManager.cs @@ -50,6 +50,26 @@ private void addTestInputManagerStep() ChildrenEnumerable = Enumerable.Empty(); }); + [Test] + public void TestInitialState() + { + AddStep("Press buttons", () => + { + InputManager.PressButton(MouseButton.Left); + InputManager.PressKey(Key.A); + InputManager.PressJoystickButton(JoystickButton.Button1); + }); + addTestInputManagerStep(); + AddAssert("pressed", () => mouse.IsPressed(MouseButton.Left) && keyboard.IsPressed(Key.A) && joystick.IsPressed(JoystickButton.Button1)); + AddStep("Release on parent", () => + { + InputManager.ReleaseButton(MouseButton.Left); + InputManager.ReleaseKey(Key.A); + InputManager.ReleaseJoystickButton(JoystickButton.Button1); + }); + AddAssert("released", () => !mouse.IsPressed(MouseButton.Left) && !keyboard.IsPressed(Key.A) && !joystick.IsPressed(JoystickButton.Button1)); + } + [Test] public void UseParentInputChange() {