1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Add 100 and 1000 key press step to test overflow

This commit is contained in:
Joseph Madamba 2023-11-02 19:46:09 -07:00
parent e3b3ce6c84
commit 3f8baf913b
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76

View File

@ -124,8 +124,15 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("Disable counting", () => controller.IsCounting.Value = false);
addPressKeyStep();
AddAssert($"Check {testKey} count has not changed", () => testTrigger.ActivationCount.Value == 2);
AddStep("Enable counting", () => controller.IsCounting.Value = true);
addPressKeyStep(100);
addPressKeyStep(1000);
void addPressKeyStep() => AddStep($"Press {testKey} key", () => InputManager.Key(testKey));
void addPressKeyStep(int repeat = 1) => AddStep($"Press {testKey} key {repeat} times", () =>
{
for (int i = 0; i < repeat; i++)
InputManager.Key(testKey);
});
}
}
}