Add failing test case for number box stack overflow scenario

This commit is contained in:
Bartłomiej Dach 2021-11-22 20:26:45 +01:00
parent 7ce5cb6162
commit 2350806b4c
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
namespace osu.Game.Tests.Visual.Settings
{
public class TestSceneSettingsNumberBox : OsuTestScene
{
[Test]
public void TestLargeInteger()
{
SettingsNumberBox numberBox = null;
AddStep("create number box", () => Child = numberBox = new SettingsNumberBox());
AddStep("set value to 1,000,000,000", () => numberBox.Current.Value = 1_000_000_000);
AddAssert("text box text is correct", () => numberBox.ChildrenOfType<OsuTextBox>().Single().Current.Value == "1000000000");
}
}
}