Add failing tests

This commit is contained in:
Dan Balasescu 2022-05-18 17:10:19 +09:00
parent e652180873
commit fe49a7e678
2 changed files with 37 additions and 0 deletions

View File

@ -863,5 +863,40 @@ public void TestApproachRateDefinedAfterOverallDifficulty()
Assert.That(decoded.Difficulty.OverallDifficulty, Is.EqualTo(1));
}
}
[Test]
public void TestLegacyAdjacentImplicitCatmullSegmentsAreMerged()
{
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
using (var resStream = TestResources.OpenResource("adjacent-catmull-segments.osu"))
using (var stream = new LineBufferedReader(resStream))
{
var decoded = decoder.Decode(stream);
var controlPoints = ((IHasPath)decoded.HitObjects[0]).Path.ControlPoints;
Assert.That(controlPoints.Count, Is.EqualTo(6));
Assert.That(controlPoints.Single(c => c.Type != null).Type, Is.EqualTo(PathType.Catmull));
}
}
[Test]
public void TestNonLegacyAdjacentImplicitCatmullSegmentsAreNotMerged()
{
var decoder = new LegacyBeatmapDecoder(LegacyBeatmapEncoder.FIRST_LAZER_VERSION) { ApplyOffsets = false };
using (var resStream = TestResources.OpenResource("adjacent-catmull-segments.osu"))
using (var stream = new LineBufferedReader(resStream))
{
var decoded = decoder.Decode(stream);
var controlPoints = ((IHasPath)decoded.HitObjects[0]).Path.ControlPoints;
Assert.That(controlPoints.Count, Is.EqualTo(4));
Assert.That(controlPoints[0].Type, Is.EqualTo(PathType.Catmull));
Assert.That(controlPoints[1].Type, Is.EqualTo(PathType.Catmull));
Assert.That(controlPoints[2].Type, Is.EqualTo(PathType.Catmull));
Assert.That(controlPoints[3].Type, Is.Null);
}
}
}
}

View File

@ -0,0 +1,2 @@
[HitObjects]
200,304,23875,6,0,C|288:304|288:304|288:208|288:208|352:208,1,260,8|0