From f577cea715f3a658a83624fcf09d5f87b284e2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 6 Jun 2025 09:08:26 +0200 Subject: [PATCH] Add failing test --- .../TestSceneReplayRecording.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneReplayRecording.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneReplayRecording.cs index 6b867a7729..8608ea1dfc 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneReplayRecording.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneReplayRecording.cs @@ -78,6 +78,16 @@ namespace osu.Game.Rulesets.Osu.Tests AddAssert("smoke button press recorded to replay", () => Player.Score.Replay.Frames.OfType().Any(f => f.Actions.SequenceEqual([OsuAction.Smoke]))); } + [Test] + public void TestPressAndReleaseOnSameFrame() + { + seekTo(0); + AddStep("move cursor to circle", () => InputManager.MoveMouseTo(Player.DrawableRuleset.Playfield.HitObjectContainer.AliveObjects.Single())); + AddStep("press X", () => InputManager.PressKey(Key.X)); + AddStep("release X", () => InputManager.ReleaseKey(Key.X)); + AddAssert("right button press recorded to replay", () => Player.Score.Replay.Frames.OfType().Any(f => f.Actions.SequenceEqual([OsuAction.RightButton]))); + } + private void seekTo(double time) { AddStep($"seek to {time}ms", () => Player.GameplayClockContainer.Seek(time));