mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 21:07:59 +09:00
Add failing test for incorrect sample control point time after paste
This commit is contained in:
parent
c328b26de1
commit
e91d3dd8b4
@ -4,6 +4,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
@ -85,11 +86,17 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
AddAssert("is one object", () => EditorBeatmap.HitObjects.Count == 1);
|
AddAssert("is one object", () => EditorBeatmap.HitObjects.Count == 1);
|
||||||
|
|
||||||
|
Slider slider = null;
|
||||||
|
AddStep("retrieve slider", () => slider = (Slider)EditorBeatmap.HitObjects.Single());
|
||||||
AddAssert("path matches", () =>
|
AddAssert("path matches", () =>
|
||||||
{
|
{
|
||||||
var path = ((Slider)EditorBeatmap.HitObjects.Single()).Path;
|
var path = slider.Path;
|
||||||
return path.ControlPoints.Count == 2 && path.ControlPoints.SequenceEqual(addedObject.Path.ControlPoints);
|
return path.ControlPoints.Count == 2 && path.ControlPoints.SequenceEqual(addedObject.Path.ControlPoints);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// see `HitObject.control_point_leniency`.
|
||||||
|
AddAssert("sample control point has correct time", () => Precision.AlmostEquals(slider.SampleControlPoint.Time, slider.GetEndTime(), 1));
|
||||||
|
AddAssert("difficulty control point has correct time", () => slider.DifficultyControlPoint.Time == slider.StartTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user